views:

39

answers:

2

I have a solution that links to several library projects located elsewhere on my hard drive (outside my solution folder).

I would like to change things so that these project folders are now inside my solution folder.

So far, I have copied the project folders into my solution folder. Taking a look at the .sln file for my project, I noticed that there are a bunch of entries that looks like this:

Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FooBar", "..\..\..\Libraries\FooBar\FooBar.csproj", "{89FABBC5-4019-4887-AFE3-B005B0471486}"

I was thinking, Wouldn't it be nice and easy if I could just get rid of ..\..\..\Libraries\ from all the relative paths?

However, these GUIDs are scaring me off. If I leave the GUIDs the same, will this cause problems?

Oh, and if you know a better way to do this, please let me know :)

+4  A: 

Yeah sure - the GUID's are unique identifiers for the individual projects, but they are not linked to the project's path in any way, shape or form. Just an identifier that is used later on in the .sln file.

To be absolutely on the safe side :-), make a backup copy of your *.sln, then edit, and open the newly edited .sln in your Visual Studio.

marc_s
I took a chance while I was waiting for an answer, and did exactly what you suggest (with the addition of a check into version control :)). Worked like a charm. Thanks and +1 for the reassurance, though.
DanM
Hmm...well now I notice that I have a problem with my setup project. The main project works fine, but my installer is not building. The error is: "An error occurred while validating. HRESULT='80004005'".
DanM
I tried rebuilding the installer from scratch. Didn't work. So, I ended up removing and adding each library project, reinstating the references in my main project, and voila, I'm back in business. So, the correct answer to my question is probably: "Sure, *as long as you don't have a Setup project*." If you do have a Setup project, you probably need to use VS and do everything through the GUI.
DanM
A: 

For the most part, this seems to work, but I ran into problems with my Setup Project/Installer. When I re-opened my solution after editing the .sln file, my solution wouldn't build. I got the following error:

An error occurred while validating. HRESULT='80004005'

I tried completely deleting and rebuilding my Setup Project from scratch, but the error remained. The only thing that worked was to remove and re-add each project using the Solution Explorer in Visual Studio.

So the lesson is: Edit the .sln project file at your own risk. If you have a Setup Project, it very well might break.

Update

Here's a link further explaining the "HRRESULT" error: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=434666

DanM