microsoft / WinObjC

Objective-C for Windows
MIT License
6.24k stars 808 forks source link

Nuget packages: Windows runtime component is not compatible with uap10.0 #2859

Open jboich opened 6 years ago

jboich commented 6 years ago

The issue is relevant for Visual Studio 15.6.1.

Project uses Nuget packages:

If UWP project has reference to the static C++ library, which has reference to the C# Windows Runtime Component, when I try to build solution in Visual Studio to deploy the app I get an error

Your project is not referencing the "UAP,Version=v10.0" framework. Add a reference to "UAP,Version=v10.0" in the "frameworks" section of your project.json, and then re-run NuGet restore.

Associated NuGet issue: 5929

Details:

This schema works for plain project converted from XCode:

{
  "dependencies": {
    "WinObjC.Frameworks": "*",
    "WinObjC.Language": "*"
  },
  "frameworks": {
    "uap10.0": {
    "imports": "native"
    }
  },
  "runtimes": {
    "win10-arm": {},
    "win10-x86": {},
    "win10-arm-aot": {},
    "win10-x86-aot": {}
  }
}

But C# Windows Runtime Component asks for UAP v.10.0.14393 as target framework when restoring packages.

If I change schema to

{
  "dependencies": {
    "WinObjC.Frameworks": "*",
    "WinObjC.Language": "*"
  },
  "frameworks": {
    "uap10.0.14393": {
    "imports": "native"
    }
  },
  "runtimes": {
    "win10-arm": {},
    "win10-x86": {},
    "win10-arm-aot": {},
    "win10-x86-aot": {}
  }
}

packages restore to C# components fine, but then I get the following error when trying to build & deploy project:

Your project is not referencing the "UAP,Version=v10.0" framework. Add a reference to "UAP,Version=v10.0" in the "frameworks" section of your project.json, and then re-run NuGet restore.

DHowett-MSFT commented 6 years ago

You may be able to unblock Visual Studio builds by unloading the project named NugetRestore. It'll fall back on Visual Studio's built-in package restorer, which might work better for you.

@Liastre-3D4M FYI