0

I have the following error after move my website from server to another server

enter image description here

I have already checked iis and make sure the app has an application pool and it points to the correct file path

here is a screenshot of my application pool

enter image description here

I even tried to add virtual directory and add application and still not working

enter image description here

Amira Elsayed Ismail
  • 9,216
  • 30
  • 92
  • 175

2 Answers2

0

Check siteMapFile attribute of sitemap

Ravindra
  • 66
  • 6
0

The possible reason behind the issue is:

  • When you create a new web application using visual studio.net, it automatically creates the virtual directory and configures it as an application. However, if you manually create the virtual directory and it is not configured as an application, then you will not be able to browse the application and may get the above error. The debug information you get as mentioned above, is applicable to this scenario. To resolve it, Right Click on the virtual directory - select properties and then click on "Create" next to the "Application" Label and the textbox. It will automatically create the "application" using the virtual directory's name. Now the application can be accessed.

  • When you have sub-directories in your application, you can have a web.config file for the sub-directory. However, there are certain properties that cannot be set in the web.config of the sub-directory such as authentication, session state (you may see that the error message shows the line number where the authentication or session-state is declared in the web.config of the sub-directory). The reason is, these settings cannot be overridden at the sub-directory level unless the sub-directory is also configured as an application (as mentioned in the above point). Mostly we have the practice of adding web.config in the sub-directory if we want to protect access to the sub-directory files (say, the directory is admin and we wish to protect the admin pages from unauthorized users). But actually, this can be achieved in the web.config at the application's root level itself, by specifying the location path tags and authorization.

in your case the site map section causing the issue. try to remove it from the config file.

You could refer this below link:

Nested ASP.NET 'application' within IIS inheriting parent config values?

Jalpa Panchal
  • 8,251
  • 1
  • 11
  • 26