-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Copy runtime libraries from references project #765
Comments
@oryol I just tried this as your described. And while I see the dlls under runtimes/win7-x86/native show app at the root of the package, as indicated by the PackagePath, I don't see them being copied in the output of applications that reference this package. Did you do anything different from what is described here to achieve that? |
The way that I managed to get this to show up during a publish of a dependent up was to do this in the lib before packaging it:
|
We need a NuGet fix before continuing this. I chatted with @dsplaisted and his suggestion is that NuGet should generate the assets.json reference to project B in a similar manner for both ProjectReference and PackageReference. Once NuGet does that, the SDK can use that information to move the files. |
@dsplaisted we need restore to find all assets that would be packed for each project, restore could then determine which assets are used and write those to the assets file. Build would then need to use only these assets for the project, the same as if it were a package. I've added more details on this in the NuGet issue tracking this. |
What is the timeframe you guys are hoping to fix this? (don't see one). |
Given the scope of change this is post RTM. |
Any csproj hacks or workarounds for this in the short term ? This is very painful for unit test projects that are trying to test a library that has a native dependency. |
So ??? |
Is there any plan to solve this eventually? How can we have unit tests referencing a project which depends on native assemblies?
Similar issues: #1088 |
…0190708.6 (dotnet#765) - Microsoft.AspNetCore.Mvc.Analyzers - 3.0.0-preview8.19358.6 - Microsoft.AspNetCore.Mvc.Api.Analyzers - 3.0.0-preview8.19358.6
I have made an extreme hack to add runtime libraries into deps.json: https://github.com/asmichi/DotNetInjectNativeFileDepsHack The problem is that runtime libraries from reference projects do not appear in |
Another thing that doesn't seem to be possible at the moment is specifying a subdirectory where the native library ends up after publish. Right now they're all emitted to the root ( |
Crossref #17527 appears to be a newer ticket specifically about lacking the |
I have Library.csproj with following code:
When I run dotnet pack, I can see native dll-s in the generated package.
If I reference this NuGet package (using my own feed) in the another project then all libraries are correctly placed into bin folder. But if I reference this project directly then libraries are not copied.
We need to have one uniform way to add native libraries into project and use them in all scenarios:
The text was updated successfully, but these errors were encountered: