Travis build for Visual Studio Solutions project not working

I am trying to build a Visual Studios Project on Travis. I have tried a lot of configurations but I keep getting the MSB4019 error: The imported project “/Microsoft.Cpp.Default.props” was not found. Confirm that the expression in the Import declaration “/Microsoft.Cpp.Default.props” is correct, and that the file exists on disk.

Screenshot of the whole error:

Error

This is the workflow:

- name: VS Project for Windows (Autotester Testing)
      if: env(USING_WINDOWS_SLN) = true
      solution: Team17/Code17/StartupSPASolution.sln
      language: csharp
      script: |
              msbuild /p:Configuration=Release StartupSPASolution.sln

Any suggestions on how to fix this?

It looks like whatever MSBuild variable is in the script before “/Microsoft.Cpp.Default.props” is not set. Can’t say anything more specific without seeing the build, so the following are guesses.


First, I don’t see os: windows and mono:/dotnet: – so it’s probable that you’re running the job in Linux with a default version of Mono installed while you probably want Windows with VS build tools.


https://stackoverflow.com/questions/50308833/trace-execution-of-msbuild-toolchain-scripts shows that this happens when

To diagnose the problem properly, run MsBuild with diagnostic output and tracing and upload the trace log somewhere for examination – to find out which exact variable it is and how the stock logic tries to fill it (most probably, by consulting the registry for VS installation paths).