包括bin目录中未引用的dll
我有一个依赖文件夹,用于我的 Web 应用程序中的 dll。有些在 Web 应用程序中被引用,有些则没有。然而,为了运行应用程序,我需要将所有 dll 放在 Web 应用程序的 bin 目录中。但我不想在网络应用程序中引用它们。有解决办法吗?我正在考虑构建后事件将所需的 dll 从依赖项复制到 bin 目录。
I have a dependency folder that I use for dll's in my web application. Some are referenced in the web application, others aren't. However for the application to run I need to have all the dll's in the bin directory of the web application. But I dont want to reference them in the web app. Is there a work around for this? I was considering the post build event to copy in the dll's required from dependencies to bin directory.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果程序集被隐式引用(您引用的程序集需要),则它们应该自动复制到输出路径。如果您使用反射动态加载某些程序集(例如某些插件),则需要将它们手动复制到
bin
文件夹中。构建后活动似乎是一个不错的方法。If the assemblies are implicitly referenced (required by assemblies you have referenced) they should be automatically copied to the output path. If there are assemblies which you are dynamically loading with reflection like form example some plugins you will need to copy them manually to the
bin
folder. A post-buid event seems like a good approach.您可以使用您提到的 PostBuild 事件或编辑项目文件以包含 MSBuild Copy Task。
检查:http://msdn.microsoft.com/en-us/library/3e54c37h .aspx
You can use PostBuild event as you mentioned or edit the project file to include MSBuild Copy Task.
Check: http://msdn.microsoft.com/en-us/library/3e54c37h.aspx