Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The requested page cannot be accessed because the related configuration data for the page is invalid

Tags:

asp.net

iis-7

I am getting this error when I try to run an ASP.NET application without a web.config file.

The requested page cannot be accessed because the related configuration data for the page is invalid

as I read, we can run .NET applications without web config files, but when I tried it is giving me the error. I am using iis 7 on windows 7 machine.

When I create the application virtual directory inside inetpub/wwwroot it works fine. Why doesn't the other directory location?

like image 865
Pradeep Avatar asked Jul 06 '11 12:07

Pradeep


People also ask

What causes server Error in '/' Application?

The “Server error in '/' application” can occur if there is a typo in the file extension, for example a file or URL that references test. htl instead of test. html. If the file name is correct, then you may need to add the MIME typeto the server.

Where is the ApplicationHost config file located?

The applicationHost. config file is typically located at C:\Windows\System32\inetsrv\config.

What is ApplicationHost config file?

ApplicationHost. config is the root file of the configuration system when you are using IIS 7 and above. It includes definitions of all sites, applications, virtual directories and application pools, as well as global defaults for the web server settings (similar to machine.


3 Answers

One reason could be the version of .NET framework (on IIS or application pool level) is different from the application one.

Another reason could be if there are modules used in your web.config which the current configuration of IIS doesn't recognize. E.g. URL rewrite or other optional modules, which you have to explicitly enable before using.

like image 133
Nikita R. Avatar answered Oct 13 '22 23:10

Nikita R.


This can be a reason:

If there is no Web.config file in the UNC directory, IIS 7.0 uses the rules that are defined for the parent directory. For the Web content to be served in this scenario, the worker-process identity must have access to the whole content directory. Otherwise, the Web request is rejected.

Details here.

like image 28
Kirill Avatar answered Oct 14 '22 00:10

Kirill


You need to set permission for your Website folder or copy them to wwwroot folder.

If you choose to set permission, there are two ways:

  • Right click on Your Website folder, or
  • Right click to Your Website in IIS

Then select Edit permission and Add a permission (IUSR - default iis user)

like image 28
SownRocker Avatar answered Oct 13 '22 22:10

SownRocker