编译错误:CS1525:无效的表达式术语'>' [英] Compilation Error : CS1525: Invalid expression term '>'

查看:167
本文介绍了编译错误:CS1525:无效的表达式术语'>'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。



我的项目中有一堂课。

例如。



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;
		}
	}
}





现在,在代码背后,我正在调用Employees属性如下所示。





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

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





注意:'<'而不是'['和'>'代替上面代码中的']'。我无法在'<'和'>'标签之间发布我的代码。



上面的表达式在我的本地机器上工作但是当我在服务器机器上部署它时,会产生编译错误,表示

无效的表达式术语'>'。



建议我。



谢谢

Imrankhan



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

推荐答案

检查.Net的版本在服务器上运行。



在本地计算机上运行时和服务器上运行时获取的数据之间是否存在差异。在本地计算机上,您可能希望连接到服务器上连接的相同数据源.1
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


检查服务器上运行的.Net版本。



在本地计算机上运行时和服务器上运行时获取的数据之间是否存在差异。在本地计算机上,您可能希望连接到服务器上连接的相同数据源。



我同意Imlan
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


检查web.config中的这一部分



check this section in web.config

<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>


这篇关于编译错误:CS1525:无效的表达式术语'&gt;'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆