简体   繁体   English

VS2013构建不包括项目依赖项的Nuget依赖项的二进制文件

[英]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: 您有三种选择:

  1. Create a post-build event that copies all the binaries from Lib to App 创建一个将所有二进制文件从Lib复制到App的构建后事件
  2. Include references to all of the binaries that are required for App to run in the project. 包括对App在项目中运行所需的所有二进制文件的引用。
  3. Make 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.

相关问题 NuGet依赖关系不使用VS2013和AWS Elastic Beanstalk进行复制 - NuGet Dependencies not copying with VS2013 and AWS Elastic Beanstalk VS2013创建一个新的MVC项目运行正常,通过NuGet更新所有软件包获取错误 - VS2013 create a new MVC project runs fine, update all packages via NuGet get error VS2013中的ILMerge生成后活动 - ILMerge in VS2013 post build activity 在VS2013中更改网站项目的baseUrl - Change the baseUrl for a Website project in VS2013 外部 VS2013 构建错误“错误 MSB4019:导入的项目<path>没有找到” - External VS2013 build error “error MSB4019: The imported project <path> was not found” 被只能在VS2013上运行的LightSwitch项目占用时,使用C#7.0调试dll并从VS 2017构建 - Debug a dll using C# 7.0 and build from VS 2017 when consumed by a LightSwitch project that can only run on VS2013 在自定义生成事件VS2013中使用编译符号(?) - using compilation symbols(?) in custom build events VS2013 如何在 Build EventS VS2013 中使用 RegAsm 注册 DLL - How to register a DLL with RegAsm in Build EventS VS2013 使用IIS设置在vs2013中加载项目失败 - Loading a project in vs2013 with IIS setting fails 如何在VS2013中使用配置特定的值设置项目设置? - How to set Project Settings with Configuration specific values in VS2013?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM