none
MSBuild Your project.json doesn't have a runtimes section

    Question

  • Hi all,

    I have an issue with MSBuild which give this message:

    C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\NuGet\15.0\Microsoft.NuGet.targets(178,5): error : Your project.json doesn't have a runtimes section. You should add '"runtimes": { "win10-x86-aot": { } }' to your project.json and then re-run NuGet restore.

    I found several similar issues in mine on StackOverflow and the solution seems to be to delete the obj folder but it was not the same context.

    I installed only MSBuild for Visual Studio 2017 (so, without Visual Studio) for using it with Jenkins. My Jenkins master is installed on a Mac OS, and MSBuild is installed on a Windows 10 PC which is used only to do this job. If I use my development machine (Windows 10 laptop with Visual Studio 2017) as Jenkins remote agent and I launch the build from Jenkins portal, it works well, but if I use the other PC with MSBuild, I have this issue.

    Note the project I want to build is an UWP project.

    Thanks
    Samuel



    Thursday, December 07, 2017 10:59 AM

Answers

  • Okay, so I solved my issue adding a <RuntimeIdentifiers> section in my CSPROJ, according to the MSDN documentation here.

    I don't know why I have not the same issue building my project with VS 2017 on my development machine, but it works...

    • Marked as answer by Samuel LIOULT Friday, December 08, 2017 1:21 PM
    Friday, December 08, 2017 1:20 PM

All replies

  • Hi Samuel LIOULT,

    Please check if they have the same version of msbuild between your laptop and building server.

    Best regards,

    Zhanglong Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, December 08, 2017 7:28 AM
    Moderator
  • Hi Zhanglong Wu,

    Thanks for your time.

    My MSBuild version on my development machine is 15.3.409.5725 and the MSBuild version on my server machine is 15.5.179.9764

    Thanks,
    Samuel

    Friday, December 08, 2017 8:34 AM
  • Okay, so I solved my issue adding a <RuntimeIdentifiers> section in my CSPROJ, according to the MSDN documentation here.

    I don't know why I have not the same issue building my project with VS 2017 on my development machine, but it works...

    • Marked as answer by Samuel LIOULT Friday, December 08, 2017 1:21 PM
    Friday, December 08, 2017 1:20 PM