简体   繁体   中英

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. There are 0 errors, 0 warnings, 0 messages in visual studio.

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. Some of the errors include:

CS1003 Syntax error, "," expected and CS1525 Invalid expression term 'double' . Both On a line like this: Function(param1, param2, out double bla, out double blu);

CS1003 Syntax error, '[' expected on a line like this: 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. But the project was still getting compiled into a nuget package in visual studio, which is why this went unnoticed. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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