问题描述
我有一个ASP.NET MVC 2应用程序。
I have an ASP.NET MVC 2 application.
- Web项目包含对SomeProject参考
- SomeProject包含ExternalAssembly1和ExternalAssembly2引用。
- SomeProject明确要求到ExternalAssembly1,但不是ExternalAssembly2。
- ExternalAssembly1调用到ExternalAssembly2
当我执行本地构建一切都很酷。所有的DLL都包含在bin \\ debug文件夹。问题是,当我使用Visual Studio 2010中发布网站命令,它部署一切,除了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.
这似乎忽略不直接使用的组件(记住,ExternalAssembly2仅由ExternalAssembly1)。
It appears to ignore assemblies that aren't directly used (remember, ExternalAssembly2 is only used by ExternalAssembly1).
有什么办法,我可以告诉Visual Studio 2010中包括ExternalAssembly2?
Is there any way I can tell Visual Studio 2010 to include ExternalAssembly2?
我可以写一个调用ExternalAssembly2一个虚拟的方法。这样做的工作,但我真的不希望有假code为VS2010造成发布的DLL的唯一目的。
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.
推荐答案
以上答案都不是足够的在我的脑海。这似乎是一个真正的错误。我会更新这个反应,如果我曾经发现一个非黑客攻击的解决方案,或Microsoft修复了这个bug。
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.
更新:
似乎并不乐观。
https://connect.microsoft.com/VisualStudio/feedback/details/731303/publish-web-feature-not-including-all-dlls
这篇关于Visual Studio 2010的发布网站功能不包括所有dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!