本文介绍了编译错误: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
推荐答案
<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:无效的表达式术语'>'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!