Need help fixing the web.config error

I created a project in vs2010 using asp.net and C# for .net 4
It runs just fine from my local machine.  I publish and deploy to a web server running IIS 7.  I created a folder under the default website and put all my files there.  Now when I tried accessing this new site and it gives error as attached below.  This is when I noticed that the web.config has the form authentication and the membership....  I just want a public page with none of these stuff.  Can I just delete all of that?  Thank you.
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 16:     <compilation debug="true" targetFramework="4.0" />
Line 17: 
Line 18:     <authentication mode="None">
Line 19:       <forms loginUrl="~/Account/Login.aspx" timeout="2880" />
Line 20:     </authentication>
 

Source File: D:\inetpub\wwwroot\pp\web.config    Line: 18

Open in new window

Web.config
lapuccaAsked:
Who is Participating?
 
Vikram Singh SainiSoftware Engineer cum AD DeveloperCommented:
Yes! You can remove all those membership, authentication and profile elements. It will work successfully. See below:

<?xml version="1.0"?>

<configuration>
  <connectionStrings>
    <add name="ApplicationServices"
         connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
         providerName="System.Data.SqlClient" />
  </connectionStrings>

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>

  <system.webServer>
     <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
</configuration>

Open in new window

0
 
lapuccaAuthor Commented:
Thank you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.