我需要在特定标识下运行IISExpress.在完成这篇文章后,如何在不同的身份下运行iisexpress应用程序池,我在\ Documents\IISExpress\config\applicationhost.config文件中更改了processModel的用户名和密码属性.
我想验证我的Web应用程序中的更改.有没有办法验证?
最终,我所追求的是我的安全性使用PrincipalPermission属性正常工作.我相信此属性上的Name属性与运行IISExpress和我的应用程序的用户相匹配.
在此先感谢您的帮助.
我需要使用powershell自动配置新的IIS服务器,我需要更改Forms身份验证功能(其overrideMode)的功能委派设置.
我基本上想要改变使用此命令时看到的overrideMode:
Get-WebConfiguration -Filter //system.web/authentication -PSPath 'MACHINE/WEBROOT/APPHOST' | fl *
Run Code Online (Sandbox Code Playgroud)
我可以使用Set-WebConfiguration为其他类型的身份验证方法设置它,例如,对于Windows身份验证,我会这样做:
Set-WebConfiguration -Filter //System.webServer/Security/Authentication/windowsAuthentication -PSPath 'MACHINE/WEBROOT/APPHOST' -Metadata overrideMode -Value Allow
Run Code Online (Sandbox Code Playgroud)
但由于某些原因我不能对//system.web/authentication做同样的事情,我不明白为什么.当我尝试时,我收到此错误:
PS H:\> Set-WebConfiguration -Filter //System.web/Authentication -PSPath 'MACHINE/WEBROOT/APPHOST' -Metadata overrideMode -Value Allow
Set-WebConfiguration : Filename: \\?\C:\Windows\system32\inetsrv\config\applicationHost.config
Line number: 974
Error: This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default
(overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".
At …Run Code Online (Sandbox Code Playgroud) 场景如下:Windows 10,VS2015 更新 3。
创建新的空白 'empty' asp.net 项目 .NET 4.5.2,并添加一个虚拟的 'index.html'。使用 IIS express(默认)运行项目:运行良好。
将服务器更改为 IIS:获取 HTTP 错误 500.19 - 内部服务器错误,错误代码 0x80070021。这表明 web.config 中的“模块”部分无效。所以我注释掉该部分并再次运行。这给出了 404 错误。
我的 JavaScript 在 IIS 上运行良好,但似乎 IIS 没有启动 ASP.NET 服务 - 对该服务的每个 ajax 调用都会导致错误 404。所以我猜 web.config 中缺少一些东西。我在 system.servicemodel 中有这个
<services>
<service behaviorConfiguration="ServiceBehavior" name="WebMap.WebMap">
<endpoint address="" behaviorConfiguration="EndpBehavior" binding="webHttpBinding"
contract="WebMap.IWebMap" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
Run Code Online (Sandbox Code Playgroud)
和文件 service1.svc 由
<%@ ServiceHost Language="C#" Debug="true" Service="WebMap.WebMap" CodeBehind="Service1.svc.cs" %>
Run Code Online (Sandbox Code Playgroud)
注意: (1) 两台不同的 PC 正在做同样的事情。(2) 如果我创建一个新的“WebAPI”项目,而不是一个“空”项目,我会得到完全相同的结果,除了更多的部分需要从“web.config”中注释掉