31

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,

Leniel Maccaferri
  • 100,159
  • 46
  • 371
  • 480
Eyla
  • 5,751
  • 20
  • 71
  • 116

14 Answers14

17

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.

David
  • 72,686
  • 18
  • 132
  • 173
  • This error accrues from the hosting side when I lunch my website – Eyla May 04 '11 at 23:11
  • If this is hosted, then you need to check with your hosting service on how to create an IIS application for your web app. What serice are you using to host this? – David May 05 '11 at 01:42
7
  • right-click virtual directory (e.g. MyVirtualDirectory)

  • click convert to application.

user1858336
  • 71
  • 1
  • 2
6

Have you configured the virtual directory as an ASP.NET application for the right framework version?

See IIS Setup

Frazell Thomas
  • 6,031
  • 1
  • 20
  • 21
5

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.

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
4

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.

Chris Haas
  • 53,986
  • 12
  • 141
  • 274
3

I got the same problem and my solution was to remove webconfig file from the directory.. then it works..

coder
  • 31
  • 1
3

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.

David Wu
  • 31
  • 1
3

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.

Venkat
  • 551
  • 6
  • 17
2

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

Suhail Mumtaz Awan
  • 3,295
  • 8
  • 43
  • 77
2

Removing the web.config-file from the IIS Directory Folder solves the problem.

Deduplicator
  • 44,692
  • 7
  • 66
  • 118
RZM
  • 33
  • 7
1

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.

Ben-Carpenter
  • 189
  • 1
  • 6
0

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>
Chris Catignani
  • 5,040
  • 16
  • 42
  • 49
0

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.

0

Just check connectivity between SQL And your App (if you used SQL)

TheSenior
  • 1
  • 1