0

Building MazeCreator solution with some .NETStandand libraries throws a thousands of errors when building from jenkins, complaining about the BCL types:

error CS0518: Predefined type 'System.Enum' is not defined or imported
error CS0518: Predefined type 'System.Int32' is not defined or imported
error CS0518: Predefined type 'System.Object' is not defined or imported 

All the environment variables set by VsDevCmd.bat were properly set on Jenkins.

The build is calling:

nuget restore
msbuild MazeCreator.sln /p:Configuration=Release

Which works fine from Developer Command Prompt for VS

Building from the command line works fine, the build is also green on AppVeyor, Linux and Mac.

Vinicius Jarina
  • 797
  • 5
  • 16

2 Answers2

1

It seems the problem was related with the Jekins Service permissions.

After change how Jenkin Service log in (MSBuild - Jenkins - Nuget integration)

The nuget can restore the .NETStandard dependencies properly and the build now is green.

Vinicius Jarina
  • 797
  • 5
  • 16
  • How did you changed the `Jenkin Service` permissions? I'm having the same problem here. – Buba Conteh Apr 23 '18 at 07:21
  • There is a `Log On` tab on your service property, also you will need to call `C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\VsDevCmd.bat` to set VS environment variables properly. – Vinicius Jarina Apr 24 '18 at 12:40
0

We had NuGet.exe checked into our SVN source tree at version 3.4.4-rtm-1321.

Then we updated it to NuGet.exe 4.7.1 using this command and then our builds started to work on Jenkins again:

NuGet.exe update -self

As an aside, we don't run Jenkins as a service, we run it as a user process so we can some DirectX unit testing which can't be done in Session 0.

Adam Davidson
  • 156
  • 1
  • 4