IIS 7 and Above
LM/W3SVC/[x]/ROOT/[Application] is not a valid IIS application
Last post Aug 10, 2007 01:57 PM by tobias123
Aug 07, 2007 01:17 PM|tobias123|LINK
i posted this message to the forums.asp.net but nobody replied - hopefully you guys can help me on this one:
I created a new web application project with visual studio 2005.
in my iis 7 (i use windows vista business) i have several websites. some are bound to port 80 - so only one is started (i know i could set a host header name but i won't do this).
i created an application on the website which had ID 4 to point to my new web application project. the project can be compiled in visual studio and i can view it in the browser,
however if i switch from source view to design view for my aspx/ascx files visual studio only shows:
Error creating control - myControl
'LM/W3SVC/3/ROOT/MyWebProject' is not a valid IIS application.
obviously VS looks for the application in the wrong place: website ID 3 instead of 4. if i click 'create virtual directory' from the properties/web settings it creates the application on the wrong web.
what to do about it?
Aug 07, 2007 05:34 PM|mvolo|LINK
My guess is that you cannot do anything about it. You have multiple sites that have identical bindings, so when Visual Studio looks up a site that is registered to listen for
http://localhost, it picks the first one it finds with a matching binding. I can tell right away that this setup is not supported by IIS or any of the products that work with it including Visual Studio, so you can expect trouble.
I am not sure if you are aware of the fact that you an easily test sites using hostheaders locally. To do that, assign the hostheaders to your websites, and then place those hostheaders into the %windir%\system32\drivers\etc\hosts file. Then, in IE you can
request your sites locally as http://site1,
http://site2, etc where site1 and site2 are your hostheaders.
If you chose to continue with this setup, you may be able to resolve the right website by doing File > Open > Web Site ... and selecting your website's name in Visual Studio, instead of opening a url which will give you the wrong match.
Hope this helps,
IIS Core Server
Visit mvolo.com for more inside information on IIS7, IIS and ASP.NET
Aug 10, 2007 01:57 PM|tobias123|LINK
as you said this was the problem.
i created individual bindings with host header names and changed the "project url" of my project in the visual studio web application settings and it worked.