简体   繁体   English

VS2019,缺少程序集

[英]VS2019, missing assemblies

Visual Studio 2019.视觉工作室 2019。

I have several assemblies in my projects.我的项目中有几个程序集。 Assembly A (nuget package), Assembly B - references to assembly A and use some classes from it, Application C - references to Assembly B and use code that inside using code from assembly A,程序集 A(nuget 包),程序集 B - 对程序集 A 的引用并使用其中的一些类,应用程序 C - 对程序集 B 的引用并使用内部代码,使用程序集 A 中的代码,

When building, output for assembly B contains assembly A, but application C doesn't contain assembly A.构建时,程序集 B 的 output 包含程序集 A,但应用程序 C 不包含程序集 A。

Is any change to get assembly A goes to output folder for application, without referencing it directly?是否有任何更改以获取程序集 A 转到 output 文件夹进行应用程序,而不直接引用它?

When netfx projects using packages.config reference a netfx shared library, the relevant references are copied across to the netfx project since the dlls are packaged with nuget.当使用 packages.config 的 netfx 项目引用 netfx 共享库时,相关引用将被复制到 netfx 项目,因为 dll 与 nuget 打包在一起。 Netstandard, however, does not include the dlss in the package but expects the top-level project to read the nuget references and get them itself.然而,Netstandard 不包括 package 中的 dlss,但希望顶级项目能够读取 nuget 参考并自行获取它们。

When using packages.config, this doesn't work so the references are missing.使用 packages.config 时,这不起作用,因此缺少引用。 If you are using package reference, then it does work.如果您使用的是 package 参考,那么它确实有效。

The solution is either to not use netstandard (which would be a shame);解决方案是不使用 netstandard(这将是一种耻辱); reference the missing nugets directly;直接引用缺失的 nugets; or ideally, change your project to package reference, if you can, so it works.或者理想情况下,如果可以的话,将您的项目更改为 package 参考,这样就可以了。

Right-click packages.config and "Convert to package reference"右键单击 packages.config 和“转换为 package 参考”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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