Link to home
Start Free TrialLog in
Avatar of jxharding
jxharding

asked on

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

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.




ASKER CERTIFIED SOLUTION
Avatar of Ted Bouskill
Ted Bouskill
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jxharding
jxharding

ASKER

The application name is valid, i can remove it, i can add it, it is not greyed out.
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]
yeah, all of them are apps, they are all on the same application pool as well, i tried different app pools as well
Have you tried them as multiple websites instead?
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.
Sorry, don't even use a virtual directly.  Point the root website at the folder and try it.
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.
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.