开发者

Is there any way to tell Visual Studio to include the config file of a subfolder in the published result?

开发者 https://www.devze.com 2023-04-12 20:06 出处:网络
When you right click on an ASP.NET project/Publish in Visual Studio, the release files will be created.

When you right click on an ASP.NET project/Publish in Visual Studio, the release files will be created.

But if a subfolder has a config file, they won't be included in the final release.

e.g.

Root/Web.config // this will be included by default
Root/Admin/Web.Config // this won't be included by default

Is there an开发者_如何学JAVAy way to tell Visual Studio to include the config file of a subfolder in the published result?

Thanks


Mark its CopyToOutputDirectory property to Always or If newer


Assuming this is a web application project (not a web site), just click on the file in the solution explorer, and press F4 to show the properties (if they aren't already showing). Make sure "Copy to Output Directory" is something other than "Do not copy" (i.e. "Copy if newer" or "Copy always"), and... that's it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号