Unable to open Web project

M

Mythran

When I try to open a web project using Microsoft Visual Studio 2003, I get
the following error message (this happens on a couple of machines in-house,
while on the rest it works without the error):

'Unable to open Web project 'Application1'. Server error: There is no web
named "/Application1".'

I have removed and then configured Front Page Server Extensions, removed and
created the Application for the Default Web Site, as well as ran
"Recalculate Web" and "Check Server Extensions" in IIS for the Default Web
Site.

Uninstalling IIS, Installing IIS, then running aspnet_regiis -i fixes the
problem, but there are too many developer machines in-house that have this
problem and going through all of this is tedious...especially since it has
re-ocurred without us being able to reproduce how it happens in order to
prevent it from happening.

Does anyone have any idea how to prevent this? How about fixing the problem
without all of the uninstalling and reinstalling of IIS and ASP.Net?

Thanks in advance,
Mythran
 
R

Robbe Morris [C# MVP]

Is Application1 a virtual directory under the root designated
for the web site on the developer's PC?

By default, ASP.NET trys to make all of your development
apps run under virtual directories.

My guess if this doesn't fix the problem, VS.NET 2003
was installed prior to installing IIS. Thus, the install
steps you took should fix the problem.

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.masterado.net

Earn $$$ money answering .NET Framework
messageboard posts at EggHeadCafe.com.
http://www.eggheadcafe.com/forums/merit.asp
 
M

Mythran

Robbe Morris said:
Is Application1 a virtual directory under the root designated
for the web site on the developer's PC?

By default, ASP.NET trys to make all of your development
apps run under virtual directories.

My guess if this doesn't fix the problem, VS.NET 2003
was installed prior to installing IIS. Thus, the install
steps you took should fix the problem.

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.masterado.net

Earn $$$ money answering .NET Framework
messageboard posts at EggHeadCafe.com.
http://www.eggheadcafe.com/forums/merit.asp

Well, Application1 gets created as a virtual directory under the root, yes.
What do you mean, "if this doesn't fix the problem"? What fix have you
suggested? I'm lost heh.

Thanks,
Mythran
 
R

Robbe Morris [C# MVP]

I meant for your other development PC's to save
you some time uninstalling and reinstalling IIS.

They may not work properly because the virtual
directory was missing and not because of an
installation problem with IIS.

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.masterado.net

Earn $$$ money answering .NET Framework
messageboard posts at EggHeadCafe.com.
http://www.eggheadcafe.com/forums/merit.asp
 
J

Juan T. Llibre

Hi, Mythran.

re:
Uninstalling IIS, Installing IIS, then running aspnet_regiis -i fixes the problem
re:
How about fixing the problem without all of the uninstalling and reinstalling of IIS and
ASP.Net?

Uninstalling and reinstalling IIS is rarely needed,
and isn't needed at all if the problem is VS.Net's.

*First* running aspnet_regiis -u
and *then* running aspnet_regiis -i

is a more complete fix than just running aspnet_regiis -i,
particularly in reference to the recreation of the ASP.NET account.

re:
this happens on a couple of machines in-house
I have removed and then configured Front Page Server Extensions, removed and created the
Application for the Default Web Site, as well as ran "Recalculate Web" and "Check Server
Extensions" in IIS for the Default Web Site.

Do you absolutely need Front Page Extensions ?

From what you say this happens "on a couple of machines in-house".

You only need Front Page Extensions installed on the production web server.
FP Extensions are not needed on the workstations.
 
M

Mythran

Juan T. Llibre said:
Hi, Mythran.

re:

Uninstalling and reinstalling IIS is rarely needed,
and isn't needed at all if the problem is VS.Net's.

*First* running aspnet_regiis -u
and *then* running aspnet_regiis -i

is a more complete fix than just running aspnet_regiis -i,
particularly in reference to the recreation of the ASP.NET account.

re:


Do you absolutely need Front Page Extensions ?

From what you say this happens "on a couple of machines in-house".

You only need Front Page Extensions installed on the production web
server.
FP Extensions are not needed on the workstations.

I have to use FPE for our projects, afaik. The way we are creating web
projects is using the following <snip>

<snip>
Public Sub CreateVirtualDirectory(ByVal Name As String, ByVal Path As
String)
Dim iisAdmin As DirectoryEntry
Dim virtualDir As DirectoryEntry

' Get the Admin object.

iisAdmin = New DirectoryEntry("IIS://localhost/W3SVC/1/Root")
Try
' Create the virtual directory.
virtualDir = iisAdmin.Children.Add(Name, "IIsWebVirtualDir")

With virtualDir
.Properties.Item("Path")(0) = Path
.Properties.Item("AspEnableParentPaths")(0) = True
.Invoke("AppCreate", False)
.CommitChanges()
End With
Catch Ex As Exception
' Show the exception's message.
MsgBox(Ex.Message)
Finally
' Cleanup.
iisAdmin.Dispose()

If Not virtualDir Is Nothing
virtualDir.Dispose()
End If
End Try
End Sub
</snip>

Using the above code, the Virtual Directory is successfully created, but I
get the error message "Unable to open Web project 'Application1'. Server
error: There is no web named '/Application1'."

We create the web application by creating the web project using the
DTE.Solution.AddFromFile method.

Hope this helps further solve my problems...

Mythran
 
J

Juan T. Llibre

re:
I have to use FPE for our projects, afaik.

That may be an unneeded rule, except for the web server.

re:
The way we are creating web projects is using the following

I see you are accessing the metabase from code, but I don't
see anything in that code which requires FP Extensions.

re:
Using the above code, the Virtual Directory is successfully created, but I get the error
message "Unable to open Web project 'Application1'. Server error: There is no web named
'/Application1'."

Creating a Virtual Directory is not the same as creating an IIS Application.

Shouldn't
.Invoke("AppCreate", False)
be
.Invoke("AppCreate", True)

?

You might also want to set the .Properties for AccessScript to
true, if you want the App to be able to serve aspx pages.

Please review :

http://tat.chillijam.co.uk/wordpress/?p=62
http://west-wind.com/weblog/posts/399.aspx
http://lzcd.com/archive/2004/11/26/241.aspx

Check those links; make the necessary changes,
and let us know how you did.
 
M

Mythran

Juan T. Llibre said:
re:

That may be an unneeded rule, except for the web server.

Yeah, but that "unneeded rule" seems to be required. The way we
programmatically add the project to the solution :(

re:

I see you are accessing the metabase from code, but I don't
see anything in that code which requires FP Extensions.

That is because I didn't post the code that adds the project to the solution
:) I'm focusing on getting this to work with FPE, even though it may not be
"needed". Getting it to work for all systems in-house would ensure that it
works in the production environment, and make me sleep easier knowing that
most, if not all, kinks have been worked out.
re:

Creating a Virtual Directory is not the same as creating an IIS
Application.

Yeah, you can create an IIS app w/o a Virtual Directory, but as you see with
my code, I am creating a Virtual Directory and then creating an IIS
application out of the Virtual Directory. The metadata SchemaClassName is
still, IIsWebVirtualDir, even after I create the app out of the virtual
directory.
Shouldn't
.Invoke("AppCreate", False)
be
.Invoke("AppCreate", True)

Testing this, I may have been switching it around to test what happens ...
maybe this fixes it :)
?

You might also want to set the .Properties for AccessScript to
true, if you want the App to be able to serve aspx pages.

We do not set AccessScript, or any other Access flags directly. Our
AccessFlags property is set to 513 on the parent (ACCESS_READ +
ACCESS_SCRIPT), which is then inherited by the Virtual
Directory/Application.
Please review :

http://tat.chillijam.co.uk/wordpress/?p=62
http://west-wind.com/weblog/posts/399.aspx
http://lzcd.com/archive/2004/11/26/241.aspx

Check those links; make the necessary changes,
and let us know how you did.

Thanks, Juan, I'll be making some more changes using some of the suggestions
you posted. I am currently reading the content of those links...and will
see if any other adjustments are needed to the code...then reply any
findings.

Mythran
 
J

Juan T. Llibre

re:
Testing this, I may have been switching it around to test what happens ... maybe this
fixes it :)

Yeah, that's the likeliest culprit. Let us know if that is the fix.
 
M

Mythran

Juan T. Llibre said:
re:


Yeah, that's the likeliest culprit. Let us know if that is the fix.

Ok, got it to work :) Regardless of how the Virtual Directory is made, I
had to set the DTE.Properties("Projects",
"WebSettings").Item("AuthoringAccess").Value to
VSLangProj.webPrjAuthoringAccess.webPrjAuthoringAccess_FileShare. This
makes FPSE un-needed now :)

So, thank you for your help. Hope this helps others if they ever creating
new project templates in VS2003 :) Took a long time to figure out, still
don't know why I can't create a Web Application using FPSE on the
developer's machine :( The error message now reads, "Unable to create Web
project 'WebApplication1'. Server Error". Doesn't even give me an error
message lol...but it does allow me to create the project using a file share
(which is why I started looking into how to do that programmatically).

Thanks again :)

Mythran
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top