Click here to Skip to main content
15,880,427 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear all,
I have created one asp.net project base on C# & SQL server data base.

but when i configure this project for publish in wwwroot. then it shown the following error.

XML
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 11:   <system.web>
Line 12:     <compilation debug="true" targetFramework="4.0" />
Line 13:     <authentication mode="Forms">
Line 14:    <forms loginUrl="~/Login.aspx" timeout="2880"  path="/"/>
Line 15:    </authentication>


Source File: C:\inetpub\wwwroot\new_nps\web.config    Line: 13




My web.comfig code is as bellow;;;;;;;;;;;;

XML
<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <connectionStrings>
    <add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />
    <add name="MemberConnectionString" connectionString="Data Source=PRODIP;Initial Catalog=Member;Persist Security Info=True;User ID=sa;Password=prodip@km" providerName="System.Data.SqlClient" />
  </connectionStrings>
  <system.web>
    <compilation debug="true" targetFramework="4.0" />
     <authentication mode="Forms">
    <forms loginUrl="~/Login.aspx" timeout="2880"  path="/"/>
    </authentication>
      <membership>
      <providers>
        <clear />
        <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
      </providers>
    </membership>
    <profile>
      <providers>
        <clear />
        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" />
      </providers>
    </profile>
    <roleManager enabled="false">
      <providers>
        <clear />
        <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
        <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
      </providers>
    </roleManager>
    <pages>
      <controls>
        <add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
      </controls>
    </pages>
  </system.web>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true" />
  </system.webServer>
</configuration>




Please help me i m new in asp.net..
Posted
Comments
Maarten Kools 30-Jul-13 8:37am    
Perhaps one of the solutions listed here[^] apply?

You are not able to manage your folders in IIS ,check the availability of your Virtual Directories or may be you have given the wrong folder or parent folder in the physical path.
 
Share this answer
 
To create virtual directory, right click on web project, select properties then web. Choose 'Use Local IIS web server' then give project url i.e http://localhost/<virtual_directory_name> and click 'Create Virtual Directory'. Then in the IIS you can see your website Sites>Default Web site>Virtual_directory_name. Then you can set default document etc

Hope this helps
 
Share this answer
 
can any one help me to edit/correction my web.config file..please help me..
 
Share this answer
 
Comments
[no name] 30-Jul-13 9:24am    
Check the link provided by ^Mo^
Asp_Learner 30-Jul-13 10:54am    
This is not a solution
prodipjsr 31-Jul-13 3:47am    
This error can be caused by a virtual directory not being configured as an application in IIS.

how can we configure.. any guide or link?
This error can be caused by a virtual directory not being configured as an application in IIS. how can we configure.. any guide or link?
 
Share this answer
 
XML
Error Summary
HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Detailed Error Information
Module  IIS Web Core
Notification    BeginRequest
Handler Not yet determined
Error Code  0x8007000d
Config Error    Configuration file is not well-formed XML
Config File \\?\C:\inetpub\wwwroot\New_NPS\web.config
Requested URL   http://192.168.1.20:80/New_NPS/login.aspx
Physical Path   C:\inetpub\wwwroot\New_NPS\login.aspx
Logon Method    Not yet determined
Logon User  Not yet determined
Config Source

   44:     </pages>
   45:   </system.web>
   46:   <system.webServer>
 
Share this answer
 
Comments
prodipjsr 31-Jul-13 6:47am    
Now show the above error mess..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900