p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: ASP.NET 3.5 Website Programming Problem Design Solution (http://p2p.wrox.com/forumdisplay.php?f=526)
-   -   Anybody knos why I'm getting build error? (http://p2p.wrox.com/showthread.php?t=80293)

krahman01 July 27th, 2010 10:01 PM

Anybody knos why I'm getting build error?
 
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\TheBeerHouse\TBH_Web\web.config 30


When I go to web.config line 30, it has,
.......
<system.web>
<authentication mode="Forms">
<forms cookieless="AutoDetect" loginUrl="~/AccessDenied.aspx" name="TBHFORMAUTH"/>
</authentication>
<pages theme="TemplateMonster" masterPageFile="~/Template.master" maintainScrollPositionOnPostBack="true">
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></controls></pages>
<!--
Possible modes are "transitional", "strict", and "legacy".
<xhtmlConformance mode="transitional" />
-->
.............

Imar July 28th, 2010 06:25 AM

You get this error when a web.config file in a subfolder not marked as an application in IIS overrides settings that can only be defined in the root of the site.

It can happen, for example, when you open C:\Inetpub\wwwroot\TheBeerHouse and then browse to http://localhost/TBH_Web instead of opening C:\Inetpub\wwwroot\TheBeerHouse\TBH_Web and browsing to http://localhost.

Hope this helps,

Imar

krahman01 July 28th, 2010 01:50 PM

Not sure what you mean! Are you suggesting to change location of the webapp? Or, are you suggesting to change anything in the web.config file? What change would that be?

Imar July 28th, 2010 03:28 PM

No, no need to change the web.config. This is about the site under IIS, or in Visual Studio, depending on where you get the error.

I don't have the book, so I don't know if this is a Web Site Project or a Web Application Project, and whether or not your site is running under IIS or under the built-in web server. That's why I could only provide some general information.

So, depending on your setup, check the project / site you opened in Visual Studio, or check the root path for the site in IIS. In both cases, you need to use C:\Inetpub\wwwroot\TheBeerHouse\TBH_Web\ and not its parent.

If this still doesn't make sense, you need to povide lots more details about your setup and actual problem.

Cheers,

Imar

krahman01 July 28th, 2010 06:30 PM

Why can't the project types be interchangeable? I'm not sure what project types I created! I just created a asp.net web application under VS 2008 and added all the Beer house files in there. It has been working all this time until yesterday when I tried to bring up this app again. Within that time, I did work with VS 2010 simultaneously. Not sure if that changes anything!

Imar July 29th, 2010 04:15 AM

Quote:

Why can't the project types be interchangeable?
Different architecture. Web Sites are basically just folders on disk, while Web Applications have a central project file. Each type has its own pros and cons.

Quote:

If this still doesn't make sense, you need to povide lots more details about your setup and actual problem.
Again: I don't have the book, so I don't know if this is supposed to be a web app or not. You also haven't answered my questions about IIS versus Visual Studio, setup, folders, the way you browse to the site, where you get the error and so on, so I can't help you here without that info

Cheers,

Imar

krahman01 July 29th, 2010 04:26 PM

Quote:

Originally Posted by Imar (Post 261002)
Different architecture. Web Sites are basically just folders on disk, while Web Applications have a central project file. Each type has its own pros and cons.

Again: I don't have the book, so I don't know if this is supposed to be a web app or not. You also haven't answered my questions about IIS versus Visual Studio, setup, folders, the way you browse to the site, where you get the error and so on, so I can't help you here without that info

Cheers,

Imar

Sorry for not providing the setup information. Now, there's a tweak I found, so, I can atleast bring up the app by browsing a file. For instance, contacts.aspx I choose 'open in the browser' it opens up and then I can browse to Homepage, or any other pages I like to...

Here it is:

VS 2008. Setup in the way so that the following comes up:

C:\Inetpub\wwwroot\TBH_Web\

Not the way as expected

C:\Inetpub\wwwroot\TheBeerHouse\TBH_Web\

Imar July 29th, 2010 05:40 PM

Quote:

Not the way as expected
Based on what?

I am sorry, but I can't help you if you don't provide relevant information. I am not sure how you think I can help you if you don't answer the questions I am asking. I don't have the book, I don't know about your system, IIS, VS and what more.

So, if you want help, please reread all my posts in this thread and try to answer the questions I am asking. Be specific. Explain what you open in VS, how you configured IIS, what you see in the browser's address bar and so on.

Imar

krahman01 July 29th, 2010 05:54 PM

Never mind! I think I solved the problem inadvertantly. Like I said, instead of opening through VS 2008 a sa project, just have to open eqach file and run.

Imar July 30th, 2010 02:21 AM

The it looks like most things are configured correctly, except for the Start Page in VS maybe? Right click the site and choose Property Pages. Then look under Start Options. Maybe it's referring to a wrong path? For a Web Application, you find similar settings in the Web tab of the Properties dialog.

Cheers,

Imar


All times are GMT -4. The time now is 02:10 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.