asp.net-mvc - 创建发布 web.config 文件

标签 asp.net-mvc asp.net-mvc-4 web-config web-config-transform

我是这种转换的新手,我不完全了解如何实现它。这些指南都没有意义。

我要补充

 <identity impersonate="true" userName="asecret" password="mysecurepassword"/>

到发布配置。

我把它放在 web.release.config 中 <system.web> 之后但它不会这样生成。

你还想做什么。

最佳答案

您可能错过了使用 xdt:Transform 进行的实际操作属性。

尝试:

<identity impersonate="true" userName="asecret" password="mysecurepassword" xdt:Transform="Insert"/>

Insert应将新元素添加到 <system.web> 下的 web.config 中部分。

如果<identity />元素已经存在于主 web.config 文件中,您可能需要使用 xdt:Transform="Replace"这会将主 web.config 中的整个元素替换为 Web.Release.config 中的元素。或者你可以使用 xdt:Transform="SetAttribute({comma listed attributes to set here})" ,这将设置您指定的属性的值。

与往常一样,您可以在 MSDN 上阅读所有转换选项。 .

关于asp.net-mvc - 创建发布 web.config 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19274036/

相关文章:

c# - 如何在 WebApi 中使用多个 GET 操作?

asp.net - 保存文件 'web.config' 要求您停止调试 session 错误

javascript - ASP.NET MVC : Timer not working in IE

c# - 如何将值从 Controller 返回到 View 的标签

c# - 使用 caSTLe-windsor 的 MVC4 中 HttpClient 的生活方式

c# - 如何在 mvc4 中水平和垂直对齐单选按钮列表值?

.net - ASP.Net 表单例份验证 10 分钟后注销用户

ssl - https URL Rewrite 重写到域根,不保留 url 结构

c# - MVC 发布不向模型添加值

asp.net - 多个实例使用共置缓存但无法访问,需要良好的命名缓存实现