1

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(); }

And many other obviously wrong errors but not on every line. Mostly "," expected errors.

codeMetis
  • 420
  • 4
  • 16
  • 1
    Did you make sure that you are using an MSBuild version that supports C#7? – Milster Oct 09 '18 at 07:53
  • Try the one from: `C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe` – Nekeniehl Oct 09 '18 at 07:54
  • Any update for this issue? You should share a simple sample and the result you build with MSBuild, and the command line you build with MSBuild. Only two compilation errors are hard to see is the problem with MSBuild. – Leo Liu Oct 10 '18 at 01:46
  • What version of .NET is your project targetting? What version of MSBUILD are you using? – DomBurf Oct 10 '18 at 10:32
  • @Nekeniehl, I was using that one. – codeMetis Oct 10 '18 at 23:27
  • @DomBurf targeting 4.5.2 – codeMetis Oct 10 '18 at 23:27
  • @Leo Liu-MSFT when I was trying to gather this information together I saw 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 I didn't notice this. I fixed the appData config up and introduced a local nuget.config in the repo to prevent that error, and the rest of the build was fine in msbuild.exe – codeMetis Oct 10 '18 at 23:28

1 Answers1

1

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.

codeMetis
  • 420
  • 4
  • 16