Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net Visual Studio安装项目中的自定义web.config_.net_Asp.net_Visual Studio_Web Config_Setup Project - Fatal编程技术网

.net Visual Studio安装项目中的自定义web.config

.net Visual Studio安装项目中的自定义web.config,.net,asp.net,visual-studio,web-config,setup-project,.net,Asp.net,Visual Studio,Web Config,Setup Project,在安装项目中,我有两个web.config文件:web.config——在开发过程中使用,以及web\u dist.config——应该包含在安装项目中的文件 我必须确保安装项目不会包括web.config,而是始终包括web\u dist.config 在文件系统->Web应用程序文件夹中,我添加了项目中的内容文件。 还包括web_dist.config并将其映射到web.config 但这发出了警告: WARNING: Two or more objects have the same ta

在安装项目中,我有两个web.config文件:
web.config
——在开发过程中使用,以及
web\u dist.config
——应该包含在安装项目中的文件

我必须确保安装项目不会包括
web.config
,而是始终包括
web\u dist.config

在文件系统->Web应用程序文件夹中,我添加了项目中的内容文件。
还包括web_dist.config并将其映射到web.config

但这发出了警告:

WARNING: Two or more objects have the same target location ('[targetdir]\web.config')
实际包含的配置文件是
web.config
,而不是
web\u dist.config

包含
web\u dist.config
(在设置中命名为web.config)的最佳选项是什么

谢谢,
德米特里。

以下技巧在你的情况下有效吗


您可以通过添加自定义文件夹并将其DefaultLocation属性设置为与第一个文件夹相同的值,然后将文件的第二个副本移动到新文件夹来更正此问题。

我可以通过将web.config的“构建操作””设置为“无”
这样,它就不会包含在安装包中

然后我只是手动添加了另一个配置文件


在这种特殊情况下,它很有魅力。

这实际上没有帮助,因为
web.config
来自应用程序的“内容文件”,并且
web\u dist.config
是手动添加的。随着解决方案的提出,我似乎将在安装中使用初始的
web.config
,这是不能完成的。不过,我现在有了一些想法。我将尝试进行实验。