简体   繁体   English

单击发布时包含其他项目的文件夹

[英]Include Folder From Other Project While Click-once Publish

I have 3 projects in my solution MainProject , Library , and Configuration . 我的解决方案中有3个项目MainProjectLibraryConfiguration In the Configuration project I have a folder named Conf that contains XML configuration files when I publish the main project the Conf folder and its content is excluded. 配置项目中,我有一个名为Conf的文件夹,当我发布主项目Conf文件夹时,该文件夹包含XML配置文件,并且不包含其内容。

How can I include the folder and the contained files while publishing? 发布时如何包含文件夹和包含的文件?

You need to specify that they are content and should be included. 您需要指定它们是内容,应该包含在内。 By default, things like XML files are set to a "Build Action" of "None". 默认情况下,诸如XML文件之类的东西被设置为“无”的“构建动作”。

In the Solution Explorer window, right-click each file to get the Properties view. 在“解决方案资源管理器”窗口中,右键单击每个文件以获取“属性”视图。 Then choose "Build Action" as "Content" and "Copy to Output Directory" to "Copy if newer". 然后选择“构建操作”作为“内容”,然后选择“复制到输出目录”以“如果更新则复制”。 When you build and/or publish, you'll see those files get the appropriate *.deploy extension in the output. 在构建和/或发布时,您将看到这些文件在输出中得到适当的* .deploy扩展名。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM