MSB6006: "ilc.exe" exited with code -1073741515 when running under local system account

0

I created a Windows machine with Visual Studio and Windows 10 Build tools. It is mentioned to be a build machine for my gitlab pipeline. Therefore I installed a gitlab runner as service on this machine and linked it with my gitlab instance. My build process is based on a cake script which calls msbuild.

I tried to call my build script when logged on and it works like a charm. But when the build is called by the pipeline and executed by the gitlab-runner service it fails with

MSB6006: "ilc.exe" exited with code -1073741515

After some research I discovered, this message means some dependency cannot be found. As I'm able to build from command line when I log on normally, I changed the user account for the service to the user I log on. Now I'm able to go one step ahead. But now I get another error:

"C:\gitlabrun\builds\pCJVLLzN\0\MyProject\client-app\MyProject.UWP\MyProject.UWP.csproj" (Build target) (1) -> (BuildNativePackage target) ->
C:\Users\admin.nuget\packages\microsoft.net.native.compiler\2.2.9-rel-29512-01\tools\Microsoft.NetNative.targets(805,5): error : System.ComponentModel.Win32Exception (0x80004005): A required privilege is not held by the client [C:\gitlabrun\builds\pCJVLLzN\0\MyProject\client-app\MyProject.UWP\MyProject.UWP.csproj] C:\Users\admin.nuget\packages\microsoft.net.native.compiler\2.2.9-rel-29512-01\tools\Microsoft.NetNative.targets(805,5): error : at Microsoft.Win32.NativeMethods.CreateDirectory(String path, SafeLocalMemHandle acl) [C:\gitlabrun\builds\pCJVLLzN\0\wol\client-app\MyProject.UWP\MyProject.UWP.csproj] C:\Users\admin.nuget\packages\microsoft.net.native.compiler\2.2.9-rel-29512-01\tools\Microsoft.NetNative.targets(805,5): error : at System.CodeDom.Compiler.TempFileCollection.CreateTempDirectoryWithAce(String directory, String identity) [C:\gitlabrun\builds\pCJVLLzN\0\MyProject\client-app\MyProject.UWP\MyProject.UWP.csproj] C:\Users\admin.nuget\packages\microsoft.net.native.compiler\2.2.9-rel-29512-01\tools\Microsoft.NetNative.targets(805,5): error : at System.CodeDom.Compiler.TempFileCollection.GetTempFileName(String tempDir) [C:\gitlabrun\builds\pCJVLLzN\0\MyProject\client-app\MyProject.UWP\MyProject.UWP.csproj] C:\Users\admin.nuget\packages\microsoft.net.native.compiler\2.2.9-rel-29512-01\tools\Microsoft.NetNative.targets(805,5): error : at System.CodeDom.Compiler.TempFileCollection.EnsureTempNameCreated() [C:\gitlabrun\builds\pCJVLLzN\0\MyProject\client-app\MyProject.UWP\MyProject.UWP.csproj] C:\Users\admin.nuget\packages\microsoft.net.native.compiler\2.2.9-rel-29512-01\tools\Microsoft.NetNative.targets(805,5): error : at System.CodeDom.Compiler.TempFileCollection.AddExtension(String fileExtension, Boolean keepFile) [C:\gitlabrun\builds\pCJVLLzN\0\MyProject\client-app\MyProject.UWP\MyProject.UWP.csproj] C:\Users\admin.nuget\packages\microsoft.net.native.compiler\2.2.9-rel-29512-01\tools\Microsoft.NetNative.targets(805,5): error : at System.CodeDom.Compiler.TempFileCollection.AddExtension(String fileExtension) [C:\gitlabrun\builds\pCJVLLzN\0\MyProject\client-app\MyProject.UWP\MyProject.UWP.csproj] C:\Users\admin.nuget\packages\microsoft.net.native.compiler\2.2.9-rel-29512-01\tools\Microsoft.NetNative.targets(805,5): error : at Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames) [C:\gitlabrun\builds\pCJVLLzN\0\MyProject\client-app\MyProject.UWP\MyProject.UWP.csproj] C:\Users\admin.nuget\packages\microsoft.net.native.compiler\2.2.9-rel-29512-01\tools\Microsoft.NetNative.targets(805,5): error : at Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromFileBatch(CompilerParameters options, String[] fileNames) [C:\gitlabrun\builds\pCJVLLzN\0\MyProject\client-app\MyProject.UWP\MyProject.UWP.csproj] C:\Users\admin.nuget\packages\microsoft.net.native.compiler\2.2.9-rel-29512-01\tools\Microsoft.NetNative.targets(805,5): error : at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromFile(CompilerParameters options, String[] fileNames) [C:\gitlabrun\builds\pCJVLLzN\0\MyProject\client-app\MyProject.UWPMyProject.UWP.csproj] C:\Users\admin.nuget\packages\microsoft.net.native.compiler\2.2.9-rel-29512-01\tools\Microsoft.NetNative.targets(805,5): error : at SerializationAssemblyGenerator.Program.CompileCode(String coreAssemblyFileName, String outputAssembly, ReferenceAssemblies referenceAssemblies, String[] sourceFiles) [C:\gitlabrun\builds\pCJVLLzN\0\MyProject\client-app\MyProject.UWP\MyProject.UWP.csproj] C:\Users\admin.nuget\packages\microsoft.net.native.compiler\2.2.9-rel-29512-01\tools\Microsoft.NetNative.targets(805,5): error : at SerializationAssemblyGenerator.Program.GenerateDataContractSerializerHelper(IEnumerable1 contracts, IEnumerable1 jsonContracts, GeneratorSettings settings, String intermediateAssembly, IEnumerable`1 wcfSerializers) [C:\gitlabrun\builds\pCJVLLzN\0\MyProject\client-app\MyProject.UWP\MyProject.UWP.csproj] C:\Users\admin.nuget\packages\microsoft.net.native.compiler\2.2.9-rel-29512-01\tools\Microsoft.NetNative.targets(805,5): error : at SerializationAssemblyGenerator.Program.Main(String[] args) [C:\gitlabrun\builds\pCJVLLzN\0\MyProject\client-app\MyProject.UWP\MyProject.UWP.csproj] C:\Users\admin.nuget\packages\microsoft.net.native.compiler\2.2.9-rel-29512-01\tools\Microsoft.NetNative.targets(805,5): error : ILT0032: Failed to compile serialization code. See the build log for error details. [C:\gitlabrun\builds\pCJVLLzN\0\MyProject\client-app\MyProject.UWP\MyProject.UWP.csproj]

What are the correct security settings to successfully run my Xamarin UWP build on a build server?

xamarin.forms
uwp
build
msbuild
asked on Stack Overflow Feb 16, 2021 by Martin H. • edited Feb 16, 2021 by Cheesebaron

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0