getting a default error page even though customErrors mode="Off"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • denny1824
    New Member
    • Dec 2007
    • 32

    getting a default error page even though customErrors mode="Off"

    I have a working website. I copied all the files to a new folder in inetpub/wwwroot and then set that folder as a Virtual Directory in IIS. I try going to that site from the new folder and i am getting a default error page. It is an aspx page that I am trying to view.

    If I put in a fake page name it gives a different error about that fake name not existing, which means to me that it is seeing the page I want to view but is giving an error and displaying the default error page:

    Code:
    Runtime Error 
    Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. 
    
    Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
    
    
    <!-- Web.Config Configuration File -->
    
    <configuration>
        <system.web>
            <customErrors mode="Off"/>
        </system.web>
    </configuration>
     
    
    Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
    
    
    <!-- Web.Config Configuration File -->
    
    <configuration>
        <system.web>
            <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
        </system.web>
    </configuration>
    I do have a web.config file on the root directory of the virtual folder with the customErrors mode = "Off". The website still works under the orignal folder.

    How can I get the website to work under a different folder name?
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Is your IIS set up to redirect the user to the default error page if an error occurs?

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      Do virtual directories allow ASPX pages to run?

      Comment

      • denny1824
        New Member
        • Dec 2007
        • 32

        #4
        to Frinavale: IIS does redirect to default page for certain HTTP errors: 403;14 is "Forbidden - Directory Listing Denied", 500 is "Internal Server Error", 501 is "Not Implemented", 502 is "Bad Gateway". I don't think I am getting any of those errors in this case. Do you know how I can be sure?

        to Plater: Yes, as far as I know, aspx pages can be run in virtual directories. I have the orignal website working just fine in a virtual directory on the same machine. The only difference here is that I copied the files into a different virtual directory.

        I need to have 2 copies so that I can make changes to one and still have the original available to be viewed. So right now I am just trying to get 2 copies of the same website working on the same machine. Maybe there is a better way to do it than put the second one in a different virtual directory?

        Comment

        • Frinavale
          Recognized Expert Expert
          • Oct 2006
          • 9749

          #5
          What version of IIS are you using?
          Please check the Windows Event Logs for an indication of the problem as well.

          Comment

          • denny1824
            New Member
            • Dec 2007
            • 32

            #6
            IIS is version 5.1
            OS is Windows XP
            I dont see anything in the event viewer that indicates the problem.

            Comment

            • Frinavale
              Recognized Expert Expert
              • Oct 2006
              • 9749

              #7
              Let's create another web site for your app.
              • Open IIS.
              • Right click on the Default Web Site.
              • Select New -> Virtual Directory
              • Click Next in the Virtual Directory Creation Wizard
              • Provide "TestWebsit e" as the Alias on the Virtual Directory Alias step and click Next.
              • Click the Browse button on the Website Content Directory step.
              • Browse to the C:\Inetpub\wwwr oot\ directory.
              • Click the Make New Folder button and name the new folder "TestWebsit e"
              • Highlight the "TestWebsit e" folder and click Ok.
              • Click the "Next" button in the Web Site Content Directory step of the wizard.
              • Make sure that Read and Run Scripts (such as ASP) are checked on the Access Permissions step and click the Next button.
              • Click the Finish button.


              Now we have a new website set up to point to a virtual directory located on the IIS.

              Open your web application in Visual Studio. In the Solution Explorer right click on your web application's name and select Publish. When prompted for the Target location click the "..." button. This will open the Open Web Site dialogue. Select "Local IIS" in the left pane of this dialogue and select "TestWebsit e" in the right pane then click the Open button. Click the Publish button in the Publish Web dialogue.

              Then try connecting to the TestWebsite (be sure to provide an aspx page to connect to in the url since we haven't set up a Default Web Page for the "TestWebsit e" website in IIS).

              -Frinny

              Comment

              • denny1824
                New Member
                • Dec 2007
                • 32

                #8
                I dont have Visual Studio on the server. I tried making TestWebsite on the development computer.

                When I try to publish TestWebsite I get the error: "You must choose a publish location that is not a sub-folder of the source Web site."

                Comment

                • Frinavale
                  Recognized Expert Expert
                  • Oct 2006
                  • 9749

                  #9
                  Publish the website to a folder on your desktop.
                  Then upload the files in that folder to the server (into the C:\Inetpub\wwwr oot\TestWebsite directory)

                  Comment

                  • denny1824
                    New Member
                    • Dec 2007
                    • 32

                    #10
                    After uploading the files to the inetpub/wwwroot folder Ii went into IIS and set it as an application in IIS.

                    It is giving the same type of default error page.

                    Comment

                    • Frinavale
                      Recognized Expert Expert
                      • Oct 2006
                      • 9749

                      #11
                      Did it give you an error before you set it up as an application?
                      Are you sure there is no errors/warnings being recorded in the Server's Window Event logs?

                      Comment

                      • denny1824
                        New Member
                        • Dec 2007
                        • 32

                        #12
                        The error it gives before I set it up as an application is the same as after except that instead of the top line being "Server Error in '/TestWebsite' Application." it says "Server Error in '/' Application."

                        To check the Server's Window Event logs I went to Control Panel -> Administrative Tools -> Event Viewer. I see a bunch of warnings and errors about a missing printer driver, but nothing that seems to me to be about websites. Nothing shows up under Internet Explorer in the Event Viewer.

                        Comment

                        • Frinavale
                          Recognized Expert Expert
                          • Oct 2006
                          • 9749

                          #13
                          Is the Default Website configured to use ASP.NET?
                          Is the testWebsite configured to use ASP.NET?
                          Is the ASP.NET version correct (please note that 2.0 works for 3.0 and 3.5 since they are addons....so long as these are installed on the server)

                          Comment

                          • denny1824
                            New Member
                            • Dec 2007
                            • 32

                            #14
                            I went back and grabbed an older copy of the website and put it on. That seems to be working. I haven't figure out what I am doing wrong with the newer version but this should work for now.

                            Thank You for your time and patience

                            Comment

                            • Frinavale
                              Recognized Expert Expert
                              • Oct 2006
                              • 9749

                              #15
                              Are you using newer DLLs in the newest version of your website?
                              Are they installed on the server?

                              Comment

                              Working...