开发者

Can I set up Windows Authentication in WebMatrix Beta 2?

I have an ASP.NET site where authentication mode="Windows". Just downloaded WebMatrix beta 2 yesterday, trying to debug my app.

In WebMatrix, I'm getting 401 errors after pressing F5 in Visual Studio. Also in VS, getting "Unable to start debugging on the web server. An authentication error occurred while communication with the web server." When I click the help button, MSDN tells me I need to enable Windows authentication.

I don't see an option for authentication in WebMatrix. This question is similar, but doesn't seem to apply for me (and no answer).

More开发者_运维技巧 info (not sure if this applies). I've enabled SSL in WebMatrix. VS is set up to use a custom web server with the URL of https://localhost:44300/routing/development.aspx. In WebMatrix, the URL in the request view is https://localhost:44300/routing/development.aspx/debugattach.aspx (not sure where debugattach.aspx is coming from).


I think I found the answer. Looks like Beta 2 (I haven't used Beta 1) has a lot of options that are not accessible via the UI.

In %My Documents%\IISExpress\config\applicationhost.config, at line 349 is

<windowsAuthentication enabled="false">

Changing "false" to "true" works for me.


Just got this working today. You'll have to edit the server's applicationhost.config file manually since there isn't any UI to it. This is located under your my documents/IISExpress/config/applicationhost.config.

Once you have this open in your favorite text editor, near the bottom you'll have to add a section of XML to setup your site to run with custom settings. The line above the </configuration> terminator, copy and past the following into your file:

<location path="SiteName">
    <system.webServer>
        <security>
            <authentication>
                <anonymousAuthentication enabled="false" />
                <basicAuthentication enabled="true" />
                <windowsAuthentication enabled="true" />
            </authentication>
        </security>
    </system.webServer>
</location>

Make sure you change path="SiteName" to have it match the website's name in WebMatrix. Also make sure you change anonymous, basic, or windows auth to true or false depending on what you need your website to run as.


I have the same issue and am also looking for a solution.

Frankly saying, I wouldn't even imagine that this should work (especially after seeing Scott Guthrie link to article that tells to use macros for attaching to iisexpress process: http://www.intrepidstudios.com/blog/2010/7/11/debug-your-net-web-project-with-iis-express-t.aspx), but this used to work properly for me in Beta 1. So, one solution for you could be to go back to Beta 1.


try

<appSettings>
  <add key="enableSimpleMembership" value="false" />
</appSettings> 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜