[英]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.如果 .NET 462 项目引用 .NET Standard 2.0 dll,则依赖项不会复制到输出 bin 文件夹。
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.当 .NET Standard 2.0 项目被引用为
<ProjectReference />
并且<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
被添加到 .NET 462 项目时,它可以正常工作。
My .NET Standard 2.0 project lives in a different solution and therefore cannot be added as project reference.我的 .NET Standard 2.0 项目位于不同的解决方案中,因此无法添加为项目参考。
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?是否有解决此问题的方法,可能会将 .NET Standard 2.0 项目的 bin 文件夹中的 deps.json 考虑在内?
Or is the only solution to add the .NET Standard 2.0 project to all solutions, where projects have references to it?或者是将 .NET Standard 2.0 项目添加到所有解决方案中的唯一解决方案,其中项目引用了它?
If you cannot add the project as a project reference, consider using NuGet to consume a built package (and the contained dependency graph).如果您无法将项目添加为项目引用,请考虑使用 NuGet 来使用构建的包(以及包含的依赖关系图)。
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.在撰写本文时,无法从一组文件中引用 .net 标准项目及其依赖项(例如在 .net 标准项目上由
dotnet publish
生成),因为需要为目标可执行项目的框架解析 NuGet 包的图(核心、.net 框架、uwp、..)和某些需要在生成和发布期间为生成的可执行项目运行的生成逻辑不是为 .net 标准项目运行的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.