Visual Studio 2017 UWP csproj file format

I was working on a UWP store app that uses a .NetCore class library (DLL) and suddenly I got a range of strange errors from the NuGet packaging system. Everything Visual Studio 2017 tried to restore packages I got errors like this:

One or more projects are incompatible with UAP,Version=v10.0 (win10-arm).
Project GameEngine is not compatible with uap10.0 (UAP,Version=v10.0) / win10-x86. Project GameEngine supports: uap10.0.14393 (UAP,Version=v10.0.14393)
Project GameEngine is not compatible with uap10.0 (UAP,Version=v10.0) / win10-arm-aot. Project GameEngine supports: uap10.0.14393 (UAP,Version=v10.0.14393)
Project GameEngine is not compatible with uap10.0 (UAP,Version=v10.0) / win10-x64. Project GameEngine supports: uap10.0.14393 (UAP,Version=v10.0.14393)
One or more projects are incompatible with UAP,Version=v10.0 (win10-x86).
One or more projects are incompatible with UAP,Version=v10.0 (win10-x64-aot).
Project GameEngine is not compatible with uap10.0 (UAP,Version=v10.0). Project GameEngine supports: uap10.0.14393 (UAP,Version=v10.0.14393)
One or more projects are incompatible with UAP,Version=v10.0 (win10-x86-aot).
Project GameEngine is not compatible with uap10.0 (UAP,Version=v10.0) / win10-x86-aot. Project GameEngine supports: uap10.0.14393 (UAP,Version=v10.0.14393)
One or more projects are incompatible with UAP,Version=v10.0.
Project GameEngine is not compatible with uap10.0 (UAP,Version=v10.0) / win10-x64-aot. Project GameEngine supports: uap10.0.14393 (UAP,Version=v10.0.14393)
One or more projects are incompatible with UAP,Version=v10.0 (win10-arm-aot).
Project GameEngine is not compatible with uap10.0 (UAP,Version=v10.0) / win10-arm. Project GameEngine supports: uap10.0.14393 (UAP,Version=v10.0.14393)
One or more projects are incompatible with UAP,Version=v10.0 (win10-x64).

Searching online didn’t help much, but after I created a new skeleton solution with the latest version of Visual Studio 2017 I discovered a difference in the csproj files, this section:

<ItemGroup>
  <!-- A reference to the entire .Net Framework and Windows SDK are automatically included -->
  <None Include="project.json" />
</ItemGroup>

was replaced by this section:

<PropertyGroup>
    <RestoreProjectStyle>PackageReference</RestoreProjectStyle></PropertyGroup>

After replacing the old section with the new in the csproj file, everything worked again.

Root cause was that the UWP project was created by an earlier version of Visual Studio 2017 and the format has changed. But that was quite hard to read from the errors above 🙂