Skip to content

(UWP) Platform Dependent UWP Library fails due to Compile-Time Reference Assembly Missing #5606

@WilliamABradley

Description

@WilliamABradley

Details about Problem

NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe):
Nuget Package Manager

NuGet version:
Package Manager Console Host Version 4.3.0.4199

VS version (if appropriate):
Visual Studio Community 2017 + Preview

OS version (i.e. win10 v1607 (14393.321)):
Windows 10 Pro Insider Preview 16237

Detailed repro steps so we can see the same problem

I'm trying to package and use my UWP Shared Code Library into NuGet so that I can use it on my apps. Since it references FFmpegInterop and the Microsoft Advertising SDK and other Platform Dependent Code, I can't use lib/uap10.0, so I have the 3 runtime folders and one folder for Reference (Here are my nuspec file references):

    <!-- Library -->
    <file src="$binaries$\Reference\Lib-Core.dll" target="ref\uap10.0" />
    <file src="$binaries$\Reference\Lib-UWP.dll" target="ref\uap10.0" />

    <file src="$binaries$\ARM\Release\Lib-Core.dll" target="runtimes\win10-arm\native" />
    <file src="$binaries$\ARM\Release\Lib-Core.pdb" target="runtimes\win10-arm\native" />
    <file src="$binaries$\ARM\Release\Lib-UWP.dll" target="runtimes\win10-arm\native" />
    <file src="$binaries$\ARM\Release\Lib-UWP.pdb" target="runtimes\win10-arm\native" />
    <file src="$binaries$\ARM\Release\Lib-UWP.pri" target="runtimes\win10-arm\native" />
    <file src="$binaries$\ARM\Release\Lib-UWP\**\*.*" target="runtimes\win10-arm\native\Lib-UWP" />

    <file src="$binaries$\x86\Release\Lib-Core.dll" target="runtimes\win10-arm\native" />
    <file src="$binaries$\ARM\Release\Lib-Core.pdb" target="runtimes\win10-arm\native" />
    <file src="$binaries$\x86\Release\Lib-UWP.dll" target="runtimes\win10-x86\native" />
    <file src="$binaries$\x86\Release\Lib-UWP.pdb" target="runtimes\win10-x86\native" />
    <file src="$binaries$\x86\Release\Lib-UWP.pri" target="runtimes\win10-x86\native" />
    <file src="$binaries$\x86\Release\Lib-UWP\**\*.*" target="runtimes\win10-x86\native\Lib-UWP" />

    <file src="$binaries$\x64\Release\Lib-Core.dll" target="runtimes\win10-arm\native" />
    <file src="$binaries$\ARM\Release\Lib-Core.pdb" target="runtimes\win10-arm\native" />
    <file src="$binaries$\x64\Release\Lib-UWP.dll" target="runtimes\win10-x64\native" />
    <file src="$binaries$\x64\Release\Lib-UWP.pdb" target="runtimes\win10-x64\native" />
    <file src="$binaries$\x64\Release\Lib-UWP.pri" target="runtimes\win10-x64\native" />
    <file src="$binaries$\x64\Release\Lib-UWP\**\*.*" target="runtimes\win10-x64\native\Lib-UWP" />

I am aware of #1221, which is why I have Reference assemblies, (Both run through CorFlags before added to my package as a reference Assembly, all using a Cake Build Script).

However,
If I try to add the Package to my UWP apps, I get:

NU1203: WilliamABradley.Shared.UWP 1.0.0 provides a compile-time reference assembly for Lib-Core on UAP,Version=v10.0.14393, but there is no run-time assembly compatible with win10-arm.
NU1203: WilliamABradley.Shared.UWP 1.0.0 provides a compile-time reference assembly for Lib-UWP on UAP,Version=v10.0.14393, but there is no run-time assembly compatible with win10-arm.
NU1203: WilliamABradley.Shared.UWP 1.0.0 provides a compile-time reference assembly for Lib-Core on UAP,Version=v10.0.14393, but there is no run-time assembly compatible with win10-arm-aot.
NU1203: WilliamABradley.Shared.UWP 1.0.0 provides a compile-time reference assembly for Lib-UWP on UAP,Version=v10.0.14393, but there is no run-time assembly compatible with win10-arm-aot.
NU1203: WilliamABradley.Shared.UWP 1.0.0 provides a compile-time reference assembly for Lib-Core on UAP,Version=v10.0.14393, but there is no run-time assembly compatible with win10-x64.
NU1203: WilliamABradley.Shared.UWP 1.0.0 provides a compile-time reference assembly for Lib-UWP on UAP,Version=v10.0.14393, but there is no run-time assembly compatible with win10-x64.
NU1203: WilliamABradley.Shared.UWP 1.0.0 provides a compile-time reference assembly for Lib-Core on UAP,Version=v10.0.14393, but there is no run-time assembly compatible with win10-x64-aot.
NU1203: WilliamABradley.Shared.UWP 1.0.0 provides a compile-time reference assembly for Lib-UWP on UAP,Version=v10.0.14393, but there is no run-time assembly compatible with win10-x64-aot.
NU1203: WilliamABradley.Shared.UWP 1.0.0 provides a compile-time reference assembly for Lib-Core on UAP,Version=v10.0.14393, but there is no run-time assembly compatible with win10-x86.
NU1203: WilliamABradley.Shared.UWP 1.0.0 provides a compile-time reference assembly for Lib-UWP on UAP,Version=v10.0.14393, but there is no run-time assembly compatible with win10-x86.
NU1203: WilliamABradley.Shared.UWP 1.0.0 provides a compile-time reference assembly for Lib-Core on UAP,Version=v10.0.14393, but there is no run-time assembly compatible with win10-x86-aot.
NU1203: WilliamABradley.Shared.UWP 1.0.0 provides a compile-time reference assembly for Lib-UWP on UAP,Version=v10.0.14393, but there is no run-time assembly compatible with win10-x86-aot.

I can force the Package by opening the Project.json file and adding the reference (I used to use Package Reference, but I switched back because I thought it might cause problems for my test app).
It seems to compile and run from Debug and Release on all Platform variants, so I'm not sure what is going on here, although Package Restore will always fail, and wont download anymore Packages with this Package here :(

Could it be that the Output folder of the runtime assemblies don't match the reference assemblies, and it is getting confused?

Sample Project

I can provide a link to anyone requiring my Library and the Test App via email if needed.

Metadata

Metadata

Assignees

No one assigned

    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