[英]VS2013 build not including binaries for Nuget dependencies of project dependency
I have a console app project (call it App) in a large solution that includes a library project (call it Lib) that my app needs to use. 我在大型解决方案中有一个控制台应用程序项目(称为App),其中包括我的应用程序需要使用的库项目(称为Lib)。
App has a project reference to Lib and Lib has references to a number of Nuget packages. 应用程序具有对Lib的项目引用,而Lib具有对许多Nuget包的引用。 When the solution is built the binaries from the Nuget packages are included in the bin folder for Lib, but while the binary for Lib itself is included in the bin folder for App, the binaries from the Nuget packages it depends on are not.
构建解决方案时,来自Nuget软件包的二进制文件包含在Lib的bin文件夹中,但是虽然包含Lib的二进制文件本身包含在App的bin文件夹中,但来自Nuget软件包的二进制文件却不包含。
This causes runtime errors in App when code in Lib attempts to reflect its dependencies. 当Lib中的代码试图反映其依赖关系时,这会在App中导致运行时错误。
Is there something I should be setting to ensure that Nuget dependencies of project dependencies are included? 我应该设置一些东西来确保包括项目依赖项的Nuget依赖项吗? I can reference the Nuget packages directly in App but there are many of them and I would rather work out the correct way of ensuring that the dependencies are resolved.
我可以直接在App中引用Nuget程序包,但其中有很多程序,我宁愿制定出确保解决依赖关系的正确方法。
You have three options: 您有三种选择:
Lib
to App
Lib
复制到App
的构建后事件 App
to run in the project. App
在项目中运行所需的所有二进制文件的引用。 Lib
into a NuGet package and then use NuGet to manage the Lib
dependency. Lib
放入NuGet包中,然后使用NuGet来管理Lib
依赖项。 All the binaries would be included. Option 2 is my general approach, although a case could be made for any of these. 备选方案2是我的一般做法,尽管其中任何一个都可以成立。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.