.NET MVC 3部署包缺少引用 [英] .NET MVC 3 Deployment package missing references

查看:218
本文介绍了.NET MVC 3部署包缺少引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在ASP.NET MVC3项目中,我有一个这样的结构:

In an ASP.NET MVC3 project I have a structure like this:

Core.csproj
 -> 3rdparty1.dll
    -> 3rdpartyreference.dll
 -> 3rdparty2.dll

Web.csproj
 -> core.dll

我在VS2010中使用Build Deployment Package功能。当我构建时,在最终bin目录中有一些引用缺少。它只包含web.dll,core.dll,3rdparty1.dll和3rdparty2.dll,但是缺少3rdpartyreference.dll。

I'm using the Build Deployment Package feature in VS2010. When I build, there are some references missing in the final bin directory. It only contains the web.dll, core.dll, 3rdparty1.dll and 3rdparty2.dll but is missing the 3rdpartyreference.dll.

如何强制部署功能复制所有必要的参考? (没有手动创建一个特定的copy something.dll指令在csproj中的后援中)

How can I force the Deployment functionality to copy all the necessary references? (without manually creating a specific "copy something.dll" instruction in the afterbuild in the csproj)

推荐答案

MSBuild任务涉及VS 2010的部署包和发布功能无法通过您的应用程序依赖于依赖于另一个的程序集来取代间接引用。您可以手动复制文件(不推荐),也可以将未使用的参考变量添加到指向thirdpartyreference.dll中的某个类的核心项目中。即使未使用此引用变量也会导致VS 2010认为您对第三方dll有明确的依赖关系,并按预期将其复制到bin目录。

The MSBuild tasks involved in the deployment package and publish features of VS 2010 fail to pickup indirect references by where your app depends on an assembly that depends on another. Either you can copy the files manually (not recommended), or you can add an unused reference variable to your core project that points to some class in the thirdpartyreference.dll. This reference variable, even if unused, will cause VS 2010 to think you have an explicit dependency on that third party dll and copy it to the bin directory as expected.

这篇关于.NET MVC 3部署包缺少引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆