发布 Web 应用程序时如何包含未引用的 dll?
我有各种 dll,但我没有在 ASP.NET 网站中直接引用,而是尝试通过 Visual Studio 2010 中的“打包/发布 Web”功能进行发布。
如何告诉发布功能需要包含哪些内容这些特定的文件?
请注意,我不想直接引用这些 dll(该解决方案已专门设置为不直接引用这些特定的 dll)。
我找到了
但我找不到专门包含文件的方法。
I have various dll's that I am not directly referencing in a ASP.NET website I am attempting to publish via the "Package/Publish Web" feature in Visual Studio 2010.
How can I tell the publishing feature that it needs to include these certain files?
Note that I do not want to directly reference these dll's (the solution has specifically been setup in a way so that these specific dll's are not directly referenced).
I've found a <ExcludeFilesFromDeployment/>
but I can't find a way to specifically include files.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您想通过 Publish 方法包含文件,您可以在 MSbuild 文件 (.*proj) 中使用“FilesForPackagingFromProject”元素。
有用的链接:http://sedodream.com/2010/05/01/WebDeploymentToolMSDeployBuildPackageInclusionExtraFilesOrExducingSpecificFiles.aspx
If you want to include files through the Publish method you could use "FilesForPackagingFromProject" elements in the MSbuild file (.*proj)
Usefull link : http://sedodream.com/2010/05/01/WebDeploymentToolMSDeployBuildPackageIncludingExtraFilesOrExcludingSpecificFiles.aspx
您可以将它们添加到项目中(就像添加图像一样)并将属性复制到输出目录更改为如果较新则复制。然后,当您构建它们时,应将它们放入垃圾箱中。当您发布时,这也应该有效。
You can add them to the project (just like you add an image) and change the property Copy To Output Directory to Copy if Newer. Then when you build they should be placed into the bin. That should work when you publish too.
它只会从您网站中的文件夹发布。我一直只是让网站引用这些文件,因此当我构建它时,它们就位于该网站的本地文件中,并将与其他所有内容一起发布。
It will only publish from the folders in your website. I have always just had the website reference those files so when I built it they were then local to the site and would be published along with everything else.