ASP.NET Web.Config转换问题
发布时间:2020-12-16 07:27:31 所属栏目:asp.Net 来源:网络整理
导读:如何使用web.config转换在我的生产web.config中包含domain属性? 我在我的基础web.config中有以下内容. authentication mode="Forms" forms loginUrl="~/Account/Login.aspx" timeout="2880" //authentication 我试图在我的web.prod.config中使用以下内容,但
如何使用web.config转换在我的生产web.config中包含domain属性?
我在我的基础web.config中有以下内容. <authentication mode="Forms"> <forms loginUrl="~/Account/Login.aspx" timeout="2880" /> </authentication> 我试图在我的web.prod.config中使用以下内容,但在发布项目时它不会添加该属性. <authentication mode="Forms" xdt:Transform="Replace"> <forms loginUrl="~/Account/Login.aspx" timeout="2880" domain=".mydomain.com" /> </authentication> 我希望输出如下. <authentication mode="Forms"> <forms loginUrl="~/Account/Login.aspx" timeout="2880" domain=".mydomain.com"/> </authentication> 解决方法
这两个中的一个应该工作(未经测试,但基于
Microsoft’s documentation):
<system.web> <authentication mode="Forms" xdt:Transform="Replace" xdt:Locator="Match(forms)"> <forms loginUrl="~/Account/Login.aspx" timeout="2880" domain=".mydomain.com" /> </authentication> </system.web> <system.web> <authentication mode="Forms"> <forms domain=".mydomain.com" xdt:Transform="SetAttributes(domain)" /> </authentication> </system.web> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net-mvc – IIS6中的ASP.NET MVC压缩选项
- razor – MVC 4 ActionLink Dictionary htmlAttributes不起
- asp.net – 是否有复杂的aspnet UI验证的设计模式?
- asp.net-mvc-3 – 如何防止ASP.NET MVC应用程序中的DoS攻击
- asp.net – 重启后,每个页面的MVC应用程序都很慢
- asp.net – 在单个位置禁用Windows身份验证
- 如何追踪每一笔记录的来龙去脉:一个完整的Audit Logging解
- asp.net-mvc – visual studio 2013“添加控制器”丢失
- asp.net-mvc – Razor模板,views和angular.js
- asp.net – OData和区分大小写
推荐文章
站长推荐
- asp.net – 防止在ASP .Net中为单个用户进行多次
- ASP.NET ReportViewer Google Chrome CPU使用情况
- asp.net-mvc – 为什么验证请求取自ASP.net MVC?
- asp.net-mvc – 从nopCommerce插件扩展Razor Par
- 使用.NET的应用程序
- ASP.NET MVC强类型视图编译错误
- .NET Core技术研究-HttpContext访问的正确姿势
- Asp.net MVC – Jquery $.ajax错误回调没有返回r
- asp.net-mvc – 如何将表单中的复选框序列化为Js
- ASP.NET MVC错误处理 – 删除aspxerrorpath
热点阅读