Click here to Skip to main content
15,847,903 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all.

I have a class in my project.
For example.

public class Employee
{
	private int _Id;
	public int Id
	{
		get { return _Id; }
		set { _Id = value; }
	}
	private static object _SyncRoot = new object();
	private static List[Employee] _Employee;
	public static List[Employee] Employees
	{
		get
		{
			if (_Employee == null || _Employee.Count == 0)
			{
				lock (_SyncRoot)
				{
					if (_Employee == null || _Employee.Count == 0)
					{
						_Employee = FillEmployeeLists(); // database method to fill employee list.
					}
				}
			}
			return _Employee;
		}
	}
}


Now, In code behind side, I am calling Employees property as below.

List[Employee] employeeList =  Employee.Employees.FindAll(E => E.Id!=1);


note : '<' instead of '[' and '>' instead of ']' in above code. I am not able to post my code in between '<' and '>' tags.

The above expression is working in my local machine but when I deploy it on server machine, it generates compilation error that says
Invalid expression term '>'.

Please suggest me.

Thanks
Imrankhan
Posted
Updated 1-May-18 9:07am
v7

Check the version of .Net running on the server.

Is there a difference between data you fetch when you are running on your local machine and on the server. On the local machine, you may want to connect to the same data source you connect to on the server.1
 
Share this answer
 
v4
Check the version of .Net running on the server.

Is there a difference between data you fetch when you are running on your local machine and on the server. On the local machine, you may want to connect to the same data source you connect to on the server.1

I am agree with Imlan
 
Share this answer
 
check this section in web.config

XML
<system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
        <providerOption name="CompilerVersion" value="v3.5" />
        <providerOption name="WarnAsError" value="false" />
      </compiler>
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
        <providerOption name="CompilerVersion" value="v3.5" />
        <providerOption name="OptionInfer" value="true" />
        <providerOption name="WarnAsError" value="false" />
      </compiler>
    </compilers>
  </system.codedom>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900