简体   繁体   中英

Transient dependencies of .NET Standard 2.0 dll are missing in bin when referenced by .NET 462 project

If a .NET 462 project references a .NET Standard 2.0 dll the dependencies are not copied to the output bin folder.

It works correctly when the .NET Standard 2.0 project is referenced as <ProjectReference /> and <RestoreProjectStyle>PackageReference</RestoreProjectStyle> is added to the .NET 462 project.

My .NET Standard 2.0 project lives in a different solution and therefore cannot be added as project reference.

Is there a solution to this problems, that maybe takes the deps.json in the bin folder of the .NET Standard 2.0 project into account?

Or is the only solution to add the .NET Standard 2.0 project to all solutions, where projects have references to it?

If you cannot add the project as a project reference, consider using NuGet to consume a built package (and the contained dependency graph).

At the time of writing, .net standard projects and their dependencies cannot be referenced from a set of files (like produced by dotnet publish on the .net standard project) since the graph of NuGet packages needs to be resolved for the target executable project's framework (core, .net framework, uwp, ..) and certain build logic that needs to run during build & publish for the resulting executable project is not being run for .net standard projects.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM