[英]Custom web.config in Visual Studio Setup Project
In the Setup Project I have 2 web.config files: web.config
- used during the development and web_dist.config
- the one that should be included into Setup Project. 在安装项目中,我有2个web.config文件: web.config
在开发过程中使用的文件和web_dist.config
应该包含在安装项目中的文件。
I must be sure the the Setup project will NOT include the web.config
and will always include web_dist.config
. 我必须确保安装项目不会包含web.config
并且始终会包含web_dist.config
。
In the File System -> Web Application Folder I have added the Content Files from the project. 在文件系统-> Web应用程序文件夹中,我从项目中添加了内容文件。
Also included the web_dist.config and mapped it to the web.config. 还包括了web_dist.config并将其映射到web.config。
But this gives the warning: 但这给出了警告:
WARNING: Two or more objects have the same target location ('[targetdir]\web.config')
And the actual config file included is web.config
and not web_dist.config
. 并且实际包含的配置文件是web.config
而不是web_dist.config
。
What would be the best option to include the web_dist.config
(and named as web.config in the setup)? 包含web_dist.config
(在安装程序中名为web.config)的最佳选择是什么?
Thanks, 谢谢,
Dmitriy. 德米特里。
I was able workaround this by setting " Build Action " for the web.config to " None ". 我可以通过将web.config的“ Build Action ”设置为“ None ”来解决此问题。
This way it doesn't get included into the setup package. 这样,它就不会包含在安装程序包中。
Then I just added another config file manually. 然后,我只是手动添加了另一个配置文件。
Works like a charm for this particular situation. 在这种特定情况下,它就像是一种魅力。
http://msdn.microsoft.com/en-us/library/zhx4ah11(VS.80).aspx http://msdn.microsoft.com/en-us/library/zhx4ah11(VS.80).aspx
Does following trick work in your case? 请问以下技巧对您有用吗?
You can correct this by adding a Custom folder and setting its DefaultLocation property to the same value as the first folder, then moving the second copy of the file to the new folder. 您可以通过添加“自定义”文件夹并将其DefaultLocation属性设置为与第一个文件夹相同的值,然后将文件的第二个副本移动到新文件夹来更正此问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.