Itiviti / gradle-msbuild-plugin

Gradle plugin for msbuild execution, supports C# project files for now
Apache License 2.0
101 stars 58 forks source link

Exception when trying to build with Jenkins on debian. #102

Closed Darkhax closed 5 years ago

Darkhax commented 5 years ago

Hello, I am trying to use this plugin to automate builds with Jenkins on a debian server. I can build the project fine from the command line using the xbuild command, however when I try to use this gradle plugin to automate things it throws an exception. Does anyone have any idea why I am getting this error, and what steps I could take to fix it?

> Configure project :
Error during project file parsing: System.TypeInitializationException: The type initializer for 'Microsoft.Build.Collections.MSBuildNameIgnoreCaseComparer' threw an exception. ---> System.EntryPointNotFoundException: GetSystemInfo
  at (wrapper managed-to-native) Microsoft.Build.Shared.NativeMethodsShared:GetSystemInfo (Microsoft.Build.Shared.NativeMethodsShared/SYSTEM_INFO&)
  at Microsoft.Build.Shared.NativeMethodsShared+SystemInformationData..ctor () [0x00023] in <f5a454bed8554c01935324e6d7db5f08>:0 
  at Microsoft.Build.Shared.NativeMethodsShared.get_SystemInformation () [0x0001e] in <f5a454bed8554c01935324e6d7db5f08>:0 
  at Microsoft.Build.Shared.NativeMethodsShared.get_ProcessorArchitecture () [0x00000] in <f5a454bed8554c01935324e6d7db5f08>:0 
  at Microsoft.Build.Collections.MSBuildNameIgnoreCaseComparer..cctor () [0x00010] in <f5a454bed8554c01935324e6d7db5f08>:0 
   --- End of inner exception stack trace ---
  at Microsoft.Build.Collections.PropertyDictionary`1[T]..ctor (System.Int32 capacity) [0x00006] in <f5a454bed8554c01935324e6d7db5f08>:0 
  at Microsoft.Build.Evaluation.ProjectCollection..ctor (System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.Collections.Generic.IEnumerable`1[T] 
Debian: 9
Mono: 4.6.2
Gradle: 4.9
gradle-msbuild-plugin: 2.21
Darkhax commented 5 years ago

Fixed this issue, it was caused by using an older version of Mono, updating to latest fixed this.