XamlCompiler.exe fails with code -1073741515 on GitLab CI

Lucas 6 Reputation points
2022-12-12T17:46:42.843+00:00

I am trying to set up CI on GitLab for my MAUI Project. My setup uses a Windows Runner with a Docker Container that uses the following .gitlab-ci.yml
`
image: mcr.microsoft.com/dotnet/sdk:6.0

stages:  
  - build  
  
build_job:  
  stage: build  
  script:  
    - "dotnet workload install maui"  
    - "dotnet restore frontend/MAUIASPDApp.sln"  
    - "dotnet build frontend/MAUIASPDApp.sln -c Debug -f net6.0-windows10.0.19041.0 --verbosity detailed"  

`

This fails with the following error message
C:\Users\ContainerUser\.nuget\packages\microsoft.windowsappsdk\1.1.3\buildTransitive\Microsoft.UI.Xaml.Markup.Compiler.interop.targets(559,9): error MSB3073: The command ""C:\Users\ContainerUser\.nuget\packages\microsoft.windowsappsdk\1.1.3\buildTransitive\..\tools\net5.0\..\net472\XamlCompiler.exe" "obj\Debug\net6.0-windows10.0.19041.0\win10-x64\\input.json" "obj\Debug\net6.0-windows10.0.19041.0\win10-x64\\output.json"" exited with code -1073741515. [C:\builds\aspd\2022\team3\frontend\MAUIASPDApp\MAUIASPDApp.csproj]

I was unable to find this error anywhere else, in spite of my setup being pretty much a direct translation of various GitHub and other CI Pipelines that I found online. My institution requires using GitLab, so using anything other than that is no option. Locally, the project builds fine. Are there any suggestions on how to proceed or what might cause this? Unfortunately, the console output is not helpful, and I am really out of ideas at this point. Thanks!

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,844 questions
.NET CLI
.NET CLI
A cross-platform toolchain for developing, building, running, and publishing .NET applications.
322 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,204 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 55,041 Reputation points
    2023-07-08T19:48:30.42+00:00

    your build is targeting net6, but it appears it a net 5 project. net5 is out of support, and you should upgrade to net 6. for maui, I'd upgrade to net 7 as it has better Maui support.

    0 comments No comments