[英]How come my solution builds in Visual Studio but not from the command line using msbuild?
[英]Visual Studio builds solution but MSBuild from the command line fails
我已经看过许多关于此主题的文章,但似乎没有一个真正能解决我的特定错误/情况(或者至少解决方案尚未奏效)。 我可以在Visual Studio中很好地构建解决方案,但使用以下命令行语句失败。
msbuild Project.sln /t:Build /p:RunOctoPack=true
我总共收到21个错误,每个错误与我在下面发布的错误类似(无效令牌)。
ApplicationConfiguration \\ ApplicationSessionService.cs(19,30):错误CS1002:; 预期的[C:\\ Projectstuff \\ Project.Common \\ Project.Common.csproj] ApplicationConfiguration \\ ApplicationSessionService.cs(19,54):错误CS1519:类,结构或接口成员声明[C中的无效标记'!=' :\\ Projectstuff \\ Project.Common \\ Project.Common.csproj] Events \\ UsbDeviceChanged.cs(48,46):错误CS1056:意外字符'$'[C:\\ Projectstuff \\ Project.Common \\ Project.Common..Common。 csproj]
该项目是使用.Net 4.5.2构建的,但是我注意到这是命令窗口中的第一批输出行之一。 同样,这是在Visual Studio 2015 Community Edition中构建的,并且我知道我的计算机上具有.Net 4.5.2框架,因此不确定是否重要。
CoreCompile:C:\\ windows \\ Microsoft.NET \\ Framework64 \\ v4.0.30319 \\ Csc.exe
上周这件事刚发生在我身上,我敢打赌,你处于同样的情况! 请在这里查看我的问题。
您的代码中可能包含不可显示的字符。 您可能想尝试在编译器报告的第一个错误的位置周围重新编写代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.