[英]Visual studio builds but msbuild does not.
I have looked at many of the similar questions, none have answered my problem thus far. 我看过许多类似的问题,到目前为止,还没有一个问题能回答我的问题。
I can't build any of the libraries/applications in the project with msbuild. 我无法使用msbuild构建项目中的任何库/应用程序。 There are 0 errors, 0 warnings, 0 messages in visual studio.
在Visual Studio中,有0个错误,0个警告和0条消息。
Even when I isolate the library, none of them compile. 即使我隔离了库,也没有一个可以编译。 There are 68 errors for the core library that is not dependant on anything except two nuget packages.
核心库有68个错误,除了两个nuget包以外,其他任何都不依赖。 Some of the errors include:
一些错误包括:
CS1003 Syntax error, "," expected and CS1525 Invalid expression term 'double' . CS1003语法错误“,”,以及CS1525无效的表达式术语“ double” 。 Both On a line like this:
Function(param1, param2, out double bla, out double blu);
两者都在这样的一行上:
Function(param1, param2, out double bla, out double blu);
CS1003 Syntax error, '[' expected on a line like this: void FuncPointer() { Obj.Function(); }
CS1003语法错误,“ [”应在这样的行上出现:
void FuncPointer() { Obj.Function(); }
void FuncPointer() { Obj.Function(); }
And many other obviously wrong errors but not on every line. 还有许多其他明显错误的错误,但并非每一行都如此。 Mostly "," expected errors.
通常为“,”预期错误。
Turns out, that something had caused Illegal characters in a Nuget.config file in AppData. 事实证明,某些原因导致AppData的Nuget.config文件中出现非法字符。 But the project was still getting compiled into a nuget package in visual studio, which is why this went unnoticed.
但是该项目仍在Visual Studio中被编译为一个nuget包,这就是为什么它没有引起注意的原因。 All the packages were already installed.
所有软件包都已安装。 I introduced a local nuget.config in the repo to prevent that error, and the rest of the build was fine in msbuild.exe.
我在存储库中引入了本地nuget.config来防止该错误,其余的构建在msbuild.exe中都可以。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.