Configuration error - asp.net

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Source Error:
Line 24: ASP.NET to identify an incoming user.
Line 25: -->
Line 26: <authentication mode="Windows"/>
Line 27:
Line 28: <!--

The ASP.NET engine is suggesting a solution to this problem and it is the most common cause for this error:
In the IIS Snap-in (Inetmgr.msc), right click your website, go to the properties dialog and on the Virtual directory tab, under "Application Settings", click "Create" to create an application for the web app.

It seems that there are multiple web.config files lying around in a single virtual directory. Just search the virtual directory, and see if that is the case; if yes, then remove the unnecessary web.config file or make the directory containing that web.config as a virtual directory too.

Related

Web config Error when using browser only

I have a website that is setup in the IIS as an application on a server. When i click a page from the IIS and click browse it loads the page fine. If i run the web app in VS2010, it launches the pages just fine. The problem is when i try to access the page from a browser it gives me this error...
Configuration Error Description: An error occurred during the
processing of a configuration file required to service this request.
Please review the specific error details below and modify your
configuration file appropriately.
Parser Error Message: It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level. This
error can be caused by a virtual directory not being configured as an
application in IIS.
Source Error:
Line 88: ASP.NET to identify an incoming user.
Line 89: -->
Line 90: <authentication mode="Windows" />
Line 91: <!--
Line 92: The <customErrors> section enables configuration
This is site is totally down due to this error and i need to get it fixed asap...google has yielded 2 results, make sure the site is set as an app in IIS which it is and also check for nested web.config files which there is only one config file. Thoughts?
It looks like you have a web.config in a sub-folder of a website that is not configured as an IIS application. You have to either make that folder a proper application, or remove that web.config file.
So for example: Your website is in: C:\inetpub\mysite, and you have: c:\inetpub\mysite\subfolder1\web.config. In order for that web.config to be accepted by IIS, you have to tell IIS that subfolder1 is an IIS application.
Have you also converted the folder you are trying to protect as a web application within IIS? Right click on the folder inside of IIS and select Convert to Application.

.net Configuration Error allowDefinition='MachineToApplication' beyond application level?

I am new to .net and I am having error while i am access to my folder
http://bassano2011.brinkster.net/ works fine
when http://bassano2011.brinkster.net/english/index.aspx
its give me following error:
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Line 37: ASP.NET to identify an incoming user.
Line 38: -->
Line 39: <authentication mode="Windows"/>
Line 40: <!--
Line 41: The <customErrors> section enables configuration
In a hosting environment they generally block the authentication to Windows, as that's need to use their server service to authenticate, witch you don't control and for that, will never work the way you expect.
The error comes up in your web.config configuration witch by IIS flow, it~s the last configuration to take care, as more are in place, normally the IIS it self and the machine.config file that sets the rules for that machine, and it's there that is "said" that you can't use `"Windows" authentication.
To avoid that error, either choose Forms or None as the parameter of your authentication mode.
To read more about authentications, please read the MSDN.
If you have configured your website by putting the published website in the wwwroot folder under the inetpub folder in the c: drive. Then, the error message, configuration error allowdefinition='machinetoapplication' beyond application level, may also come if you have not converted your website to an application.
To convert the website to an application, you need to open the IIS window-->Right-click your website folder under the Sites node-->Select Convert to Application.
Further, ensure that you have added an application pool for the same.
Try comment the --> in the web.config file of the sub folder in an application.Please check the following posts.
http://www.joelevi.com/blog/index.php/2007/07/aspnet-error-it-is-an-error-to-use-a-section-beyond-application-level/
http://dotnet-magic.blogspot.com/2008/11/it-is-error-to-use-section-registered.html
Hope this helps
There are two reason for that,
If you have not Configured your application to run on IIS then Create a virtual directory and assign permissions to Application .
2.check whether you are having two web.config file.

Server Error in '/' Application. ASP.NET

Greeting,
I developed a website using ASP.Net 3.5 and C#. It is working good with Visual Stdio 2010.
I uploaded my website to my domain under the public folder.
First time I lunched my website for testing (http://wecoders.com/Habib_cuizine/Gallery.aspx)
I would revive (Server Error in '/' Application.)
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
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".
<!-- 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
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>
To fix this error I added to the webConfig file inside tag:
> <customErrors mode="Off"/>
After that when I lunch the website I would receive a new error as listed bellow:
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Source Error:
Line 35: ASP.NET to identify an incoming user.
Line 36: -->
Line 37: <authentication mode="Windows" />
Line 38: <!--
Line 39: The section enables configuration
Source File: \10.0.40.35\wecoders.com\public\habib_cuizine\web.config Line: 37
Please advice how to fix this error and how configure my website which developed using Visual Stdio 2010 to be published in the internet.
Regards,
The key information in this error is this line:
This error can be caused by a virtual
directory not being configured as an
application in IIS.
In IIS, you can have several applications, but they must be configured as an application. Generally, when you create a web project it maps directly to an IIS application.
Check with your hosting service on how to create an IIS application for your web app.
Edit - added
If this is on your server, you can set this up yourself following the instructions in #Frazell Thomas's answer. He beat me to finding that link. To save yourself some reading, you should be able to focus in on the Creating Virtual Directories and Local Web Sites section.
right-click virtual directory (e.g. MyVirtualDirectory)
click convert to application.
Have you configured the virtual directory as an ASP.NET application for the right framework version?
See IIS Setup
Look at these two excerpts:
I uploaded my website to my domain under the public folder.
and
This error can be caused by a virtual directory not being configured as an application in IIS.
It's pretty clear to me that you did exactly what you said you did, and no more, i.e. you transfered the files to the web server, but nothing else. You need to configure that public folder as a virtual directory in IIS as the error is telling you, or it's just not going to work.
Looks like you have <authentication mode="Windows" /> in your web.config file but your hosting provider won't let you use that. Just remove that line.
I got the same problem and my solution was to remove webconfig file from the directory.. then it works..
http://www.velocityreviews.com/forums/t123353-configuration-error.html
If you want to use inetpub/wwwroot/aspnet as your application, remove this
line :
Line 26:
and any other lines which define MachineToApplication beyond application
level
If you want to use d:\inetpub\wwwroot\aspnet\begin\chapter02\ as your
application,
create an IIS Application which points to
d:\inetpub\wwwroot\aspnet\begin\chapter02\
maybe you can refer link above.
For my application, my web.config store in d:\inetpub\wwwroot\aspnet\begin\chapter02\
and when i move the web.config to d:\inetpub\wwwroot\aspnet and the problem is solve.
Please check also does your application have two web.config file.
Looks like this is a very generic message from iis.
in my case we enabled integrated security on web config but forgot to change IIS app pool identity.
Things to check -
go to event viewer on your server and check exact message.
-make sure your app pool and web config using same security(E.g Windows,integrated)
Note: this may not help every time but this might be one of the reason for above error message.
I have the same issue, my application was running on amazon vps, lately i found that bin folder had multiple copies of dll's ...
After removing those copies of dlls like entityframework(copy1).dll, errors were gone....
May be some one will get help...cheers
Removing the web.config-file from the IIS Directory Folder solves the problem.
Try removing the contents of the <compilers> tag in the web.config file. Depending on who you're hosting with, some don't allow the compiler in production.
Your application is trying to compile when it is called and their servers won't allow it.
This wont necessarily fix the problem...but it will tell you what the real problem is. Its currently trying to use a custom error page that doesn't exist.
If you add this line to Web.config (under system.web tag) it should give you the real error.
<system.web>
<!-- added line -->
<customErrors mode="Off"/>
<!-- added line -->
</system.web>
If your project is linq with Sql Database.
Then Simply Check your System Services and Start sql Server Agent Service.
Now your problem is solved.
Just check connectivity between SQL And your App (if you used SQL)

How do I solve an <authentication mode="Forms"> Server Error?

I've made an ASP.NETapplication in Visual Studio. When it was ready I did "Publish Website". I placed the created folder on my website.
When I go to the application on my site, I get the following error:
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Source Error:
Line 47: ASP.NET to identify an incoming user.
Line 48: -->
Line 49: <authentication mode="Forms" />
Line 50:
Line 51: <customErrors mode="Off">
Source File:
\CLST_SMB1IIS\WebfarmData$\WebData\winckelmans.net\wwwroot\bookstore\web.config
Line: 49
How do I solve this?
It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
As it says, the Virtual Directory is not being configured as an ASP.NET application.
You may have to go to your IIS admin console, go to the directory properties and select "Create Application". To do so:
Open the IIS Administration Console on the server where the application is published
Right click on the Virtual Directory where the application files are published
Select Properties, then a "Main Properties" dialog pops up.
There is a "Application Settings" section. Just hit "Create" in front of the "Application Name" textbox, then hit "Ok"
Check that the Virtual Directory appears with a different icon, it should be ok now.
My issue was with an ASP.NET Web API application that had more than one web.config (one in root and other in the Views folder). I'd mistakenly added the configuration in the sub folder and left the root folder unchanged to using "None".
Copy your folder which contains your content under wwwroot directory.
Then open IIS Manager.
Find Sites->Default Web Site->YourContentFolder
right click on it
select "convert to application"
Then it should be OK...
I had this issue when I upgraded a project containing Telerik ASP.NET UI controls. When the upgrade ran I forgot to untick the "backup" check box and a backup copy was put inside my solution. This resulted in two copies of web.config - deleted the backup folder and all was well again.
go to "Run"
"ïnetmgr"
then in the left menu default website then select your web folder ->
right click on your web folder ->and select convert to application

ASP.NET Error when trying to access page

Im getting this odd error:
Any help would be great?
This is the error:
Server Error in '/Rugby' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Source Error:
Line 33:
Line 34:
Line 35: <roleManager enabled="true">
Line 36:
Line 37: <providers>
Source File: C:\Websites\ADHS\andyhollis.co.uk\rugby\admin\web.config
Line: 35
Show Additional Configuration Errors:
It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
(C:\Websites\ADHS\andyhollis.co.uk\rugby\admin\web.config
line 43)
It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
(C:\Websites\ADHS\andyhollis.co.uk\rugby\admin\web.config
line 67)
Version Information: Microsoft .NET
Framework Version:2.0.50727.3053;
ASP.NET Version:2.0.50727.3053
This sometimes happens when you have a Web.config in a subdirectory of the application's root.
Alternatively, you may need to go into the virtual directory and configure it correctly as an application (as noted by the error message).
It could be because you've accidentally uploaded a web.config to a non-root directory, or because the directory containing the web.config isn't configured as an application root.
As it says in the error message:
"This error can be caused by a virtual directory not being configured as an application in IIS."
Configure it as an application, and it will be fine.
IIS 5/6:
http://msdn.microsoft.com/en-us/library/zwk103ab.aspx
IIS 7:
http://mvolo.com/blogs/serverside/archive/2007/07/12/Creating-IIS7-sites_2C00_-applications_2C00_-and-virtual-directories.aspx
Basically, ASP.NET allows for hierarchical configuration files, starting from machine.config and numerous security based web.config files tucked away in the framework's config folder, and then going from the root of your web application down the subfolders.
However, some elements can only be overriden in the root web.config for each application. These include (but aren't limited to):
Authentication
Profile
RoleManagement
SecurityPolicy
SiteMap
The full list of web.configuration elements can be found under here, and each one has a section Element Information, with a subsection "Configurable locations". If it says "Virtual or physical directory–level Web.config" then you can have the element anywhere.
As this is presumably the admin screens of your application, you probably don't want to make the directory an application in it's own right - if you do you'd lose access to the main application below it, which isn't what you'd want, and you'll possibly also have to have a seperate /bin folder under there with the admin .dll in.
You would be better off configuring the RoleManagement in the root web.config of your site, (either at / or if Rugby is an application, then at /Rugby) and only having the elements you need to be different (e.g. the autherization element to lock out users) in the web.config in /Rugby/Admin.
For example, on one of my sites, the web config in the admin folder is just:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<authorization>
<!-- Allow users in role "Editor" -->
<allow roles="Editor" />
<!-- Block everyone else -->
<deny users="*" />
</authorization>
</system.web>
</configuration>
It looks like the error you didn't post has changed. Now it's "500 Internal Server Error". That usually means an unhandled exception. Look in the Windows Event Log to see what happened.

Resources