简体   繁体   中英

Server Error - Access denied

I've got this error when I run my web app in my visual studio 2012. This happens after I've changed the web config to windows authentication mode.

These are the lines of codes I've changed from the original web config.

     <httpRuntime targetFramework="4.5" />
        <authentication mode="Windows" />
        <identity impersonate="true" />
        <roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider">
            <providers>
                <clear />
                <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
            </providers>
        </roleManager>
        <authorization>
            <deny users="?" />
        </authorization>

Actually, when I deployed this project to the web server, it works perfectly fine. Now, my problem is that I could not debug this project using the visual studio 2012 cuz I have this error. I've tried opening other project and it works using the visual studio and mine is not but these two have same set-up.

在此处输入图片说明

In Visual Studio, in your project properties, you can choose which type of server you want. You must choose "IIS Server" and "Create virtual directory" to be in the same configuration as your deployment server and be able to set all needed parameters. You'll certainly need to open IIS manually (outside of VS) to configure security settings on your development WebSite.

Please try following:

  1. Go to IIS Server, Click on Web site you created and look for Windows Authentication, It should not be disabled
  2. Check the folder were you kept you code and look try to give the full permission to the current AD user.
  3. Alternatively, you can try creating the .html page in you home directly and try browsing the page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM