Saturday, March 31, 2012

web.config for IIS

I have this web.config file for my program. It works fines WebMatrix server but when I port them to real company server, which uses IIS, it says error.
Web.config file as:

<configuration>
<system.web>
<customErrors mode ="Off"/>
<authentication mode="Forms">
<forms loginUrl="login.aspx" protection="All" timeout="30"
</forms>
</authentication>
<authorization>
<deny users="*" />
</authorization>
</system.web>
</configuration
Error as:

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 2: <system.web>
Line 3: <customErrors mode ="Off"/>
Line 4: <authentication mode="Forms">
Line 5: <forms loginUrl="login.aspx" protection="All" timeout="30">
Line 6:

Source File: F:\Inetpub\client\terveysmaailma\www\DataManagement\web.config Line: 4

Anyone can tell me problem or more car should be done with IIS. I am quite new and it already takes time for me with webmatrix.

Regards.On the company server you need to create a virtual directory in IIS which points to the folder your application is sitting in. That will fix the problem. ASP.net will then be treated as its own application and not a sub directory.
Hi!

I confirm what you said with the testing. Now the question is that is it true that we can have many virtual directory. A sub directory of a virtual directory can be set to be virtual directory too.

Regards.

0 comments:

Post a Comment