Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » Visual Studio 2008 -- Move Web Site -- "The project file or web cannot be found"

This thread is locked; no one can reply to it. rss feed Print
Visual Studio 2008 -- Move Web Site -- "The project file or web cannot be found"
bamccaig
Member #7,536
July 2006
avatar

Visual Studio 2008:

  1. File > New > Web Site...

  2. Everything is happy. Develop a simple Web application to test WebServices, WebMethods, and JavaScript "proxy" objects.

  3. Attempt to store solution/project in a version control repository, and realize that the solution/project files were not put where I specified. The source files are in...

  4. Copy solution files into the correct directory.

  5. Attempt to open solution.

  6. Visual Studio can't open the project because The project file or web cannot be found.

  7. Search file system for a project file to no avail.

  8. Learn that apparently "Web Sites" created with Visual Studio have no project file.

Does anybody know how I can fix this so I can open the solution again from the directory I want it in?

CGamesPlay
Member #2,559
July 2002
avatar

If you created the project using your local IIS install, go to the IIS MMC snap-in and change the path of the Application. If you are using the ASP.NET Development Web Server, open the solution file in Notepad and edit the paths.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

bamccaig
Member #7,536
July 2006
avatar

CGamesPlay said:

If you created the project using your local IIS install, go to the IIS MMC snap-in and change the path of the Application. If you are using the ASP.NET Development Web Server, open the solution file in Notepad and edit the paths.

I'm using the ASP.NET Development Web Server, but the paths in the solution file seemed correct and it still didn't work... :-/ It might help though if I knew what those paths were relative to...

CGamesPlay
Member #2,559
July 2002
avatar

I think you might also be able to say Okay at the message box, delete the project, then right click on the solution->Add->Web Site (Existing)... Then choose the relocated directory.

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

bamccaig
Member #7,536
July 2006
avatar

I'll give it a shot when I get back to work... :)

** EDIT **

OK, I changed the paths in the .sln file from "..\..\..\src\www\" to "." and the solution opened! Unfortunately, the .sln file was listed in the project files and it appears to have created a new solution file back in the...

%USERPROFILE%\Documents\Visual Studio 2008\Projects<i><project></i>

...directory. :-/

SO on with plan B. I put the original paths back in the solution file and when it failed to open the project I deleted the project and attempted to create a new project from existing files. Unfortunately, that feature seems to only support console applications, Windows applications, and class libraries... :(

I noticed there is a File > Open > Web Site... option which asks for a directory. I specified the source code directory and it worked to open it again. Unfortunately, stupid Visual Studio creates new solution files back in the...

%USERPROFILE%\Documents\Visual Studio 2008\Projects<i><project></i>

...directory again! >:( So I'm not sure what to do... It seems Microsoft is just insisting that you store those files in that directory... >:(

** EDIT **

Though I suppose I don't really need the project/solution files versioned anyway. :-/

** EDIT **

Oh, I think I got it!! OK, so again File > Open > Web Site..., but this time before closing the solution I went to File > Save, which brought up a dialog to select a location/name for the solution file. I put it where I want it and it seems to have worked. \o/

CGamesPlay
Member #2,559
July 2002
avatar

Quote:

Though I suppose I don't really need the project/solution files versioned anyway. :-/

Bad thoughts. They control the build process for the web site. Even if they are automatically generated right now, you may need to add a custom step later.

Quote:

Oh, I think I got it!! OK, so again File > Open > Web Site..., but this time before closing the solution I went to File > Save, which brought up a dialog to select a location/name for the solution file. I put it where I want it and it seems to have worked. \o/

Yeah, Visual Studio is funny with the way that new solutions are created on disk but aren't actually "saved"... I though VS asked you to save it before you quit though. I guess you leave VS up while you go home ;)

One more thing you may want to do: change Visual Studio's project location. It's located in the options somewhere. I set mine to C:\projects :)

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

bamccaig
Member #7,536
July 2006
avatar

CGamesPlay said:

I though[t] VS asked you to save it before you quit though. I guess you leave VS up while you go home ;)

It asked me, but AFAIK didn't prompt me for a path. It just asked if I wanted to save the changes to the solution, which would be applied to the default path which was back in the default project location.

CGamesPlay said:

One more thing you may want to do: change Visual Studio's project location. It's located in the options somewhere. I set mine to C:\projects :)

It seems I'm beginning to use a $HOME/src/<project>/trunk/ path for my projects. So unless Visual Studio offers a variable system that I could use to replace the project name automatically, I doubt I can configure it to just work. As is, when I tell Visual Studio to create a project there it names the project trunk, which I probably can't get around without manually correcting it. :P

Go to: