Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
WilliamABradley opened this issue Jul 16, 2017 · 9 comments

Comments

@WilliamABradley
Copy link

WilliamABradley commented Jul 16, 2017

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.

@emgarten
Copy link
Member

@WilliamABradley would you share the list of files in your nupkg?

The runtime assembly check is done by verifying that each assembly file name under ref/ is found under a lib/ or runtimes/ folder. Do your assemblies keep the same name between these folders?

@WilliamABradley
Copy link
Author

@emgarten
The XML above is directly from my Nuspec.
The ref assemblies are a copy of the x86 Assemblies, run through CorFlags.exe.

@emgarten
Copy link
Member

emgarten commented Jul 26, 2017

The XML above is directly from my Nuspec.
The ref assemblies are a copy of the x86 Assemblies, run through CorFlags.exe.

This doesn't tell me the actual names and paths. A flat list of files would be helpful here.

@WilliamABradley
Copy link
Author

WilliamABradley commented Jul 26, 2017

@emgarten
File Tree

I have already discovered one issue, where the Lib-Core.dll were all in one runtimes folder, however, it is also saying that message for Lib-UWP.dll, which is in all runtime folders.

@emgarten
Copy link
Member

For Lib-UWP.dll on win10-arm these errors look unexpected, but for win10-arm-aot I don't see a runtimes folder which makes those errors correct.

@WilliamABradley
Copy link
Author

Do I need to make a duplicate of Assemblies for AOT?

@WilliamABradley
Copy link
Author

WilliamABradley commented Jul 26, 2017

@emgarten I tried again after fixing my Lib-Core.dll, I'm still getting the same Error for all Runtime Types (Including ARM, x86 and x64 which I do have runtime assemblies for).

@WilliamABradley
Copy link
Author

@emgarten any news?

@nkolev92
Copy link
Member

nkolev92 commented Apr 6, 2020

Thank for you reporting this issue.
At this point, the issue has been open for a very long time, and we consider it as stale and closing.
If you are still facing an issue please feel free to open a new one at NuGet/Home

@nkolev92 nkolev92 closed this as completed Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants