简体   繁体   中英

blank asp.net site shows web.config error when i try to access it

I have created a blank asp.net website consisting of a blank default.aspx page, its .cs file, a login.aspx page and its .cs and a web.config. I'm looking to test .net authentication as seen in here on the MSDN site. I've copied everything as shown in the article. I set up the site in IIS6 now when I go to the site I get the runtime error with the:

"To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off"."

message. when I add the customErrors mode="On" tag to the web.config I still get this error like its not looking at the web.config. I've triple checked IIS and its definitely looking at the right site folder. Here's my web.config:

<?xml version="1.0"?>   
 <configuration>

        <system.web>
          <customErrors mode="On"/>
           <authentication mode="Forms">
             <forms loginUrl="Logon.aspx" name=".ASPXFORMSAUTH">
             </forms>
           </authentication>

          <authorization>
            <deny users="?" />
          </authorization>
           <compilation debug="false" targetFramework="4.0" />

        </system.web>

    </configuration>

I usually set sites up through CMS installations. This is the first time I've done one from a blank site in visual studio. Is there more you need to add to web.config?

set

      <customErrors mode="Off"/>

to see the actual error.

You need to set

Not "On" to see the actual error with stacktrace.

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