Thursday, April 14, 2011

RunTime Error

hi guys, I am running a shopping cart application in asp.net.I am running my application in IIS.I am getting following error while running.

Server Error in '/cart' 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 32: --> Line 33: Line 34: Line 35:

Source File: D:\ecomm_3_1_LITE\wwwroot\web.config Line: 34


Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

Following is my web.config file

Asp.Net Configuration option in Visual Studio. A full list of settings and comments can be found in machine.config.comments usually located in \Windows\Microsoft.Net\Framework\v2.x\Config -->

 <!-- SQL SP & TABLES PREFIX -->
 <add key="SQLprefix" value="gaspprod_"/>


</appSettings>

<connectionStrings> 
<add name="ConnStr" connectionString="Data Source=GRAPHIX\SQLEXPRESS;Initial Catalog=GlitzCart;Integrated Security=True " providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
 <globalization uiCulture="en" culture="en-US"/>
 <!--<globalization uiCulture="hr" culture="hr-HR"/>-->

 <authentication mode="Forms"> 
  <forms name="guru_aspnet_cart"
      protection="All"
      timeout="30"
      path="/"
      loginUrl="AdminLogin.aspx"></forms>
 </authentication>

 <pages maintainScrollPositionOnPostBack="false"
     buffer="true"
      validateRequest="false"
     compilationMode="Auto"></pages>
 <customErrors mode="Off"
      defaultRedirect="error.html"></customErrors>
 <compilation debug="true">
 </compilation>
 <!--<trace  enabled="true"  pageOutput="true"/>-->

</system.web>

<!--disable access to Admin directory for everyone, except for the administrators -->
<location path="admin"  allowOverride="false">
 <system.web>
  <authorization>
   <allow users="admin, admin2, malik "/> <!--ADMINISTRATORS USERNAMES, SEPARATED BY ", " -->
   <deny users="*"/>
  </authorization>
 </system.web>
</location>

<!--disable access to Admin/Modules directory -->
<location path="admin/modules"  allowOverride="false">
 <system.web>
  <authorization>
   <deny users="*"/>
  </authorization>
 </system.web>
</location>

<!--disable access to Modules directory -->
<location path="modules"  allowOverride="false">
 <system.web>
  <authorization>
   <deny users="*"/>
  </authorization>
 </system.web>
</location>

<!--disable access to Modules directory -->
<location path="SQLbackup"  allowOverride="false">
 <system.web>
  <authorization>
   <deny users="*"/>
  </authorization>
 </system.web>
</location>

What change i have to make my application run?Can anybody help?

From stackoverflow
  • The error itself asks if you've enabled the virtual directory and set it as an application.

    Is that the case? Your web.config is in the file root so I would say no.

    Regardless, have you double checked you've enabled applications, enabled the correct version of ASP.NET and ensured ASP.NET is permitted to run.

    If they are all ok then I would recommend you next take a vanilla ASP.NET website/web application (I prefer the latter) and deploy it to that folder. Don't write any code and double check it works.

    If it doesn't then the default web.config doesn't work. It could be an error with your machine.config or something similar. Personally I'd reinstall and re-register .NET. A sledgehammer approach!

    If it does work, then your web.config may be corrupt.

    These are all guess-timates but I hope they help out!

    S

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.