简体   繁体   English

.NET 462 项目引用时,bin 中缺少 .NET Standard 2.0 dll 的瞬态依赖项

[英]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.

相关问题 在.Net标准2.0项目中添加dll参考 - Adding dll reference in .Net standard 2.0 project 当我将.NET Standard 2.0 DLL库与.NET Framework控制台应用程序一起使用时,如何设置依赖关系? - How to set dependencies when I use .NET Standard 2.0 DLL libraries with a .NET Framework console application? 当项目升级到 .Net Framework 4.7.2 时,从面向项目的 .Net Framework 4.6 引用的 DLL 不再出现在 bin 中 - Referenced DLL From Project Targeting .Net Framework 4.6 is no longer appearing in bin When Project Upgraded to .Net Framework 4.7.2 Python .Net未加载.Net Standard 2.0 dll - Python .Net Not loading .Net Standard 2.0 dll .NET Framework 2.0 无法引用 .NET Standard 2.0 - .NET Standard 2.0 cannot be referenced in .NET Framework 2.0 注册 .Net Standard 2.0 DLL 时忽略连接的 WCF 服务? - Ignoring the connected WCF Service when registering a .Net Standard 2.0 DLL? .NET Core 2.0项目会生成,但不会被另一个.NET Core 2.0项目引用 - .NET Core 2.0 Project Builds But Not When Referenced By Another .NET Core 2.0 Project 在NET Standard项目中消耗.NET 4.6.1 NuGet软件包的问题(bin中缺少dll) - Problem consuming .NET 4.6.1 NuGet packages in NET Standard project ( missing dlls in bin ) 如何访问 .NET Standard 2.0 DLL 中的文件? - How to access a file in .NET Standard 2.0 DLL? 具有NET标准2.0的引用项目的UWP(UAP 10.0.16299)出现LINQ(IEnumerable)问题 - UWP (UAP 10.0.16299) with referenced project with .Net standard 2.0 occurs problem with LINQ (IEnumerable)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM