Skip to content

UAP - platform specific binaries not picked up from runtimes #1221

@furmek

Description

@furmek

My NuGet package contains .dll files that are build for specific platforms (arm, x86 and x64).
The project.lock.json file seems to be updating just fine but the project will build only in x86.
When trying to build in x64 or arm the runtimes/win10-[platform] is ignored - VS will complain about lib arhitecture:

There was a mismatch between the processor architecture of the project being 
built "AMD64" and the processor architecture of the reference 
"C:\Users\Daniel\.nuget\packages\MySDK\2.1.0\runtimes\win10-x86\lib\uap10.0\MySDK.dll", "x86". 

The nupkg structure goes like this:

"MySDK/2.1.0": {
      "type": "Package",
      "files": [
        ...
        "runtimes/win10-arm/lib/uap10.0/MySDK.dll",
        "runtimes/win10-x64/lib/uap10.0/MySDK.dll",
        "runtimes/win10-x86/lib/uap10.0/MySDK.dll",
        ...
      ]
    }

After installing my project.lock.json gets updated with following data:

"targets": {
    "UAP,Version=v10.0": {
      "MySDK/2.1.0": {
        "compile": {
          "runtimes/win10-x86/lib/uap10.0/MySDK.dll": {},
        },
        "runtime": {
          "runtimes/win10-x86/lib/uap10.0/MySDK.dll": {},
        }
      }
    },
    "UAP,Version=v10.0/win10-arm": {
      "MySDK/2.1.0": {
        "compile": {
          "runtimes/win10-arm/lib/uap10.0/MySDK.dll": {},
        },
        "runtime": {
          "runtimes/win10-arm/lib/uap10.0/MySDK.dll": {},
        }
      }
    },
    "UAP,Version=v10.0/win10-x64": {
      "MySDK/2.1.0": {
        "compile": {
          "runtimes/win10-x64/lib/uap10.0/MySDK.dll": {},
        },
        "runtime": {
          "runtimes/win10-x64/lib/uap10.0/MySDK.dll": {},
        }
     ....

I have tried to remove compile and runtime from "UAP,Version=v10.0" but after doing so, VS no longer can see namespaces in those libraries.

MySDK does not have AnyCPU version and it is compiled specifically for UWP (former UAP).
Am I doing something wrong or is this a bug ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions