Solved

cannot debug or load up web page ASP.NET (Visual web developer 2010 express)

Posted on 2011-02-11
13
1,000 Views
Last Modified: 2012-05-11
I've installed visual web developer 2010 express and just typed up my first asp.net page

Each time I click on 'Debug'

I get this ERROR message:
Error      1      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.      C:\inetpub\wwwroot\Lynda ASP.Net  Exercise\Ch01GettingStarted\HelloWorld\Web.config      12      

and output message:
Validating Web Site
Building directory '/Exercise/Account/'.
C:\inetpub\wwwroot\Exercise\Ch01HelloWorld\Web.config(12): Build (web): 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.

Any clues?
0
Comment
Question by:jeremyll
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
  • 3
13 Comments
 
LVL 5

Expert Comment

by:karthitron
ID: 34869765
Set the folder "Ch01HelloWorld" in C:\inetpub\wwwroot\Exercise\ as virtual directory.
0
 

Author Comment

by:jeremyll
ID: 34869795
@karthitron

I did do that through IIS, but im still getting the same error message.
0
 
LVL 5

Expert Comment

by:karthitron
ID: 34870132
What version of IIIS you are using.

1. Confirm whether any web.config is there in any other sub folder, if so, create virutal directory for each sub folder, haing the web.config.
2. Confirm whether the website opened in visual studio is the root directory of the website having web.config file.

For more causes:
http://dotnet-magic.blogspot.com/2008/11/it-is-error-to-use-section-registered.html?showComment=1255557256812#c1453036979266449646

http://forums.iis.net/t/1148147.aspx

http://social.msdn.microsoft.com/Forums/en/windowsazure/thread/1164186d-e1dc-440b-b745-02a00eb66909
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 11

Expert Comment

by:b_levitt
ID: 34871532
I would remove the part in your web.config that says "allowDefinition='MachineToApplication' ".  

I have no idea why a tutorial set would have that in there in the first place.  It's something that restricts configuration settings on higher level config files (like in a hosting environment, where the host wants to restrict clients).
0
 

Author Comment

by:jeremyll
ID: 34881426
I've deleted all instance of the web.config file in the directory.

I'm not sure if I'm setting up the virtual directory correctly. I just go into windows 7 IIS Manager then right click on the website folder and select 'add virtual directory'.

I'm still having the same problem.
0
 

Author Comment

by:jeremyll
ID: 34881453

@b_levitt i tried removing  'allowDefinition='MachineToApplication' from the web.config file which didn't work.




<?xml version="1.0"?>

<!--
  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" />
  </connectionStrings>

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

    <authentication mode="Forms">
      <forms loginUrl="~/Account/Login.aspx" timeout="2880" />
    </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>

  </system.web>

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

Open in new window

0
 
LVL 11

Expert Comment

by:b_levitt
ID: 34887631
Please define "didn't work."  Was there an error message?
0
 
LVL 5

Expert Comment

by:karthitron
ID: 34888075
I think, there is problem in creation of virutal directory in windows 7. Please go through the steps for creating and testing the site as mentioned in below URL:
http://technet.microsoft.com/en-us/library/cc771804(WS.10).aspx
0
 

Author Comment

by:jeremyll
ID: 34895880
I still have the same problem at the moment.

When i tried to create the virtual directory through IIS manager and clicked 'Test Settings...' I get an exclaimation mark next to Authorization: cannot verify access to path c:\inetpub\wwwroot\folder

The server is configured to use pass-through authentication with a built-in account to access the specified physical path. However, IIS Manager cannot verify whether the built-in account has access. Make sure that the application pool identity has Read access to the physical path. If this server is joined to a domain, and the application pool identity is NetworkService or LocalSystem, verify that <domain>\<computer_name>$ has Read access to the physical path. Then test these settings again.

0
 

Author Comment

by:jeremyll
ID: 34895906
I have a feeling i need to fix something else first before this problem gets fixed. So i created another question here: http://www.experts-exchange.com/Software/Server_Software/Web_Servers/Microsoft_IIS/Q_26817910.html 

It's this error:

Error Summary HTTP Error 401.3 - Unauthorized You do not have permission to view this directory or page because of the access control list (ACL) configuration or encryption settings for this resource
0
 

Author Comment

by:jeremyll
ID: 34895909
I think the problem above is related to this one.
0
 
LVL 11

Expert Comment

by:b_levitt
ID: 34896230
I"m still waiting on clarification of "didn't work".  I will review your other question.
0
 
LVL 11

Accepted Solution

by:
b_levitt earned 500 total points
ID: 34896736
I think the problem here is this tutorial package is forcing you into IIS rather than just using the built in development server in visual studio.  There's a lot to learn with IIS as it is, and you're trying to do it before you've created even a simple "hello world" style web app.

I would start with the walk-throughs here:
http://msdn.microsoft.com/en-us/library/y9d53c8d.aspx

Specifically I would do this one.  It's very simple and does not use IIS.
http://msdn.microsoft.com/en-us/library/9z74w20y.aspx

I've chosen these because they are specific to version 2010.  After you get a little comfort with VS2010, I would recommend the asp.net "Ramp Up":
http://msdn.microsoft.com/en-us/rampup/dd861531.aspx

The ramp ups have video tutorials, virtual labs (which eliminate any local pc issues since you get a remote desktop), etc.  These won't be specific for vs2010, but entry level concepts of asp.net havn't changed since 2005.

From there you'll get some understanding of how things should be working and then you can move on to publishing to IIS.

0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question