Asp.net Webdeployment 项目覆盖 applicationSettings
我在 vs 2008 中获得了一个用于 Web 应用程序项目的 Web 部署项目。 在构建 Web 部署项目时,我想替换 web.config 中的属性。
我的设置是由设计者自动生成的。
<applicationSettings>
<NAMESPACE.Properties.Settings>
<setting name="Testenvironment" serializeAs="String">
<value>True</value>
</setting>
</NAMESPACE.Properties.Settings>
</applicationSettings>
在包含特定服务器设置的配置文件中,如下所示:
<?xml version="1.0"?>
<applicationSettings>
<NAMESPACE.Properties.Settings>
<setting name="Testenvironment" serializeAs="String">
<value>False</value>
</setting>
</NAMESPACE.Properties.Settings>
</applicationSettings>
遗憾的是,这不起作用。我收到错误“configSource 文件的格式必须是包含部分名称的元素”,突出显示第二行(第二个示例代码)。
标签必须如何命名才能使一切正常工作?
编辑:删除“applicationSetting”标签也不起作用。
I got a web deyploment project for a web application project in vs 2008.
While building the web deployment project, I want to replace properties in the web.config.
My settings are autogenrated by the deisgner.
<applicationSettings>
<NAMESPACE.Properties.Settings>
<setting name="Testenvironment" serializeAs="String">
<value>True</value>
</setting>
</NAMESPACE.Properties.Settings>
</applicationSettings>
In the config file which contains the settings for the specific server looks like the following:
<?xml version="1.0"?>
<applicationSettings>
<NAMESPACE.Properties.Settings>
<setting name="Testenvironment" serializeAs="String">
<value>False</value>
</setting>
</NAMESPACE.Properties.Settings>
</applicationSettings>
Sadly, this does not work. I get an error "The format of a configSource file must be an element containing the name of the section" that highlights the second line (2nd example code).
How must the Tag be named in order to make evertything work?
Edit: Deleting the "applicationSetting"-Tags does not work either.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
找到问题/解决方案:
在网络部署项目中我说的是,
而不是
现在工作正常
Found the problem/solution:
In the web deployment project I said that
rather than
Works fine now