简体   繁体   English

Msbuild.exe中的静态枚举类出错

[英]Error in Msbuild.exe for static enum class

I have enums added in the static partial class (Helper.cs). 我在静态部分类(Helper.cs)中添加了枚举。 When i reference this enum in other files, automatically using block is added like - " using static Common.Util.Helper " 当我在其他文件中引用此枚举时,会添加自动使用块,如“ 使用静态Common.Util.Helper

So If i do msbuild from folder - " Microsoft.NET\\Framework64\\v4.0.30319\\MSBuild.exe " its not working and giving an error like below - 所以,如果我从文件夹中做msbuild - “ Microsoft.NET \\ Framework64 \\ v4.0.30319 \\ MSBuild.exe ”它不起作用并给出如下错误 -

error CS1041: Identifier expected; 错误CS1041:预期的标识符; 'static' is a keyword 'static'是一个关键字

But in VS 2015 it builds fine. 但是在VS 2015中,它建立得很好。 I am using VS 2015 and Framework version 4.5. 我使用的是VS 2015和Framework 4.5版。 So do i need to any settings in msbuild or any solution for this ? 那么我需要msbuild中的任何设置或任何解决方案吗?

Thanks in advance !! 提前致谢 !!

Use 采用

"C:\\Program Files (x86)\\MSBuild\\14.0\\Bin\\MSBuild.exe"

instead. 代替。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM