Solved

yet another as allowDefinition='MachineToApplication' beyond application level; tried ALL other,good explanationg given

Posted on 2008-09-30
9
1,061 Views
Last Modified: 2012-05-05
yet another as allowDefinition='MachineToApplication' beyond application level.
i have created apps in .net 2003 and .net 2005 and both frameworks are on my server 2003 / iis6 machine.

it always been a mission to get .net apps working on this classic asp setup and today i have spent more than 8 hours on this so far.

all the other googled solutions say:
check the web config in backup folder /
make sure the virtual directory is an application / etc.

now ive done it from scratch: i've "published" the website in 2005 VS to a folder.
my website is for e.g. abc.co.uk.
i now made a folder NewProg in the C:\Inetpub\wwwroot\abc folder. (this root folder does not have an app.config).
now i just make the abc folder a virtual directory (haven't set the app yet).

i now make the folder an application [create button].
i now have this setup in IIS:
-abc
   -oldprog [App]
   -oldprog2 [App]
   -newprog [App]

i now go to abc.co.uk/newprog/login.aspx on local browser:
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.

i now go to abc.co.uk/newprog/login.aspx on remote PCbrowser:
custom error etc

i again metion there is no web.config in abc root, and no web.config in any subfolder of newprogram

i now remove the web.config file in newprogram. now for the first time, the login page actually displays, but when i try to login, i get the error that the password is incorrect [im using forms authentication with the username/passwords in the web.config] obviously because the web.config isn't there.
but still the page actually loaded now. if i try another page, i get the error:
Could not load the assembly 'App_Web_vxxxx'. Make sure that it is compiled before accessing the page. This is because the app.config isnt there.


i searched for other web.configs. there are only in the oldprog and oldprog2 folders.
 the version of .net is 2.0xxxx which is correct and the problem is not there.

like i said : when i remove the web.config i can actually view a page (that doesnt refer to files in app_data). when i put it back, i get the error.
this would tell me that i have another web.config in the parent of newprogram.
i dont.
the default web site [under IIS-> Websites] has wwwroot set as an app, but that doesnt bother oldprogram to work, so it shouldn;t bother newprogram to work either.

i cannot for the love of programming get this, please help, theres a lot at stake.




0
Comment
Question by:jxharding
  • 5
  • 4
9 Comments
 
LVL 51

Accepted Solution

by:
tedbilly earned 500 total points
ID: 22611475
If you right click on the web site or the virtual folder for the web application is the 'Application Name' disabled (greyed out)?  If yes, you didn't designate the folder as an application just like the message says.

Select the [Create] button to make it an application which assigns a application pool to the folder so that it can run as a web application.
0
 

Author Comment

by:jxharding
ID: 22611899
The application name is valid, i can remove it, i can add it, it is not greyed out.
0
 
LVL 51

Expert Comment

by:tedbilly
ID: 22611940
Sorry I didn't make it clear.  I know you mentioned doing it at the root, I meant each individual virtual folder if each is it's own web application.

So in other words use the [Create] button on
   -oldprog [App]
   -oldprog2 [App]
   -newprog [App]
0
 

Author Comment

by:jxharding
ID: 22611989
yeah, all of them are apps, they are all on the same application pool as well, i tried different app pools as well
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 51

Expert Comment

by:tedbilly
ID: 22612012
Have you tried them as multiple websites instead?
0
 

Author Comment

by:jxharding
ID: 22612078
we have another website, using the same file system, e.g. abcd.co.uk.
i have now tried adding the newprogram virtual directory to it, and making it an app, this works fine, but it still shows the same error when i try to run it.
0
 
LVL 51

Expert Comment

by:tedbilly
ID: 22618804
Sorry, don't even use a virtual directly.  Point the root website at the folder and try it.
0
 

Author Comment

by:jxharding
ID: 22621763
hi, i copied oldprogram's files into newprogram folder
now everything worked.

thus, it had to be the program itself.

i then compared the web.configs.
in the faulty version, i took out this line :
<compilation debug="true">
<assemblies>
<add assembly="WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>
</compilation>

now everything (almost everything) works. really funny stuff, the only part that i still get the error on is on a page where i create .docx files with MemoryStream & Package & PackageRelationshipCollection. i must prob install .net 3.5 on the webserver

thanks for the help.
0
 

Author Comment

by:jxharding
ID: 22676638
well, just for reference sake, i got this error again.
what happened was that i put a link button onto a page, and then , without recompiling it, published it to the webserver.

now this thing published, but there was an error on it, that Visual Studio would have picked up. Its a really kak idea not to do error checking when the "publish to web site" button is pressed.

im just documenting this because this is a horrid message to get and can mean anything, its worse than classic asp's messages.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Here are the symptoms: You start receiving calls from users that one of your legacy web apps isn't coming up, so you log into your IIS 5 server to check it out.  When you pull up the services, you notice that the WWW Publishing service isn't runn…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now