本文介绍了Visual Studio 2010发布Web功能不包括所有DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ASP.NET MVC 2应用程序。




  • Web项目包含对SomeProject的引用

  • SomeProject包含对ExternalAssembly1和ExternalAssembly2的引用。

  • SomeProject显式调用到ExternalAssembly1中,但不显示外部调用ExternalAssembly2。

  • ExternalAssembly1调用到ExternalAssembly2



当我执行本地构建时,一切都很酷。所有DLL都包含在bin\debug文件夹中。问题是,当我在Visual Studio 2010中使用Publish Web命令时,它将部署除ExternalAssembly2之外的所有内容。



它似乎忽略了不直接使用的程序集(记住,ExternalAssembly2仅由ExternalAssembly1使用)



有没有办法让Visual Studio 2010包含ExternalAssembly2?



我可以写一个调用ExternalAssembly2的虚拟方法。这样做是有效的,但是我真的不想让虚拟代码的唯一目的是使VS2010发布DLL。

解决方案

这些答案在我脑海中都没有了。这似乎是一个真正的错误。如果我找到一个非黑客解决方案,或者Microsoft修复了这个错误,我将更新此回复。



更新:



似乎没有希望。


I have an ASP.NET MVC 2 application.

  • Web project contains a reference to SomeProject
  • SomeProject contains references to ExternalAssembly1 and ExternalAssembly2.
  • SomeProject explicitly calls into ExternalAssembly1, but NOT ExternalAssembly2.
  • ExternalAssembly1 calls into ExternalAssembly2

When I perform a local build everything is cool. All DLLs are included in the bin\debug folder. The problem is that when I use the Publish Web command in Visual Studio 2010, it deploys everything except ExternalAssembly2.

It appears to ignore assemblies that aren't directly used (remember, ExternalAssembly2 is only used by ExternalAssembly1).

Is there any way I can tell Visual Studio 2010 to include ExternalAssembly2?

I can write a dummy method that calls into ExternalAssembly2. This does work, but I really don't want to have dummy code for the sole purpose of causing VS2010 to publish the DLL.

解决方案

None of these answers are sufficient in my mind. This does seem to be a genuine bug. I will update this response if I ever find a non-hack solution, or Microsoft fixes the bug.

Update:

Doesn't seem promising.https://connect.microsoft.com/VisualStudio/feedback/details/731303/publish-web-feature-not-including-all-dlls

这篇关于Visual Studio 2010发布Web功能不包括所有DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-13 18:10