When adding my solution to Vault, I get this message: "Other users may have trouble opening this solution from the repository." What's going on?
- AddSolutionWarning.png (17.66 KiB) Viewed 23954 times
The short answer is that your solution file is not at the top of your source tree, and it should be.
What does that mean? It means you have files that belong to your solution that are not beneath the solution folder on disk.
This is okay:
Here we have a solution with one project in the same folder as the solution, and two projects in folders under the solution.
Code: Select all
C:\
MyWork\
MySolution\ <-- Solution folder
MySolutionFile.sln
MainProject.vcproj <-- Project in the
main.c solution folder
MyProject\
MyProject.csproj <-- Project beneath the
Class1.cs solution folder.
MyOtherProject\
MyOtherProject.vbproj <-- Project beneath the
Class1.vb solution folder
This is not okay:
Here we have a solution with a project that is not beneath the solution folder.
Code: Select all
C:\
MyWork\
MySolution\ <-- Solution's folder
MySolutionFile.sln
MainProject.vcproj <-- Project in the
main.c solution folder
MyProject\
MyProject.csproj <-- Project beneath the
Class1.cs solution folder
SomeOtherWork\
MyOtherProject\
MyOtherProject.vbproj <-- Project NOT beneath
Class1.vb the solution folder
that may cause trouble
Why is this a problem? Let's say you added this second example to Vault, ignoring the warning. The next day your colleague wants to work on this new project, and does an Open From Vault. When prompted, he chooses to put the solution in a disk path that makes sense on his machine:
Because of how you arranged the solution on disk, MySolutionFile.sln contains this path to MyOtherProject.vbproj:
Code: Select all
..\..\SomeOtherWork\MyOtherProject\MyOtherProject.vbproj
Now your colleague has put that solution file in c:\NewProject. You can't go up the file system tree twice from there. Visual Studio can't find the project file, and Vault doesn't know where to put it. Even if your colleague fixes up the solution to work from c:\NewProject on his system, he breaks your environment as soon as he checks in the modified solution file.
If, by some kind of policy or procedure external to Vault, every member of your team has exactly the same disk structure, you can work this way. You get the warning when you add a solution like this, but you can choose to ignore it if you understand the consequences. As long as the appropriate disk layout is possible on everybody's machine, Vault will do the Right Thing.
If you think you can safely ignore the warning, you should also be aware of user-specific paths. If you have a project here:
Code: Select all
C:\Documents and Settings\Joe\My Documents\Visual Studio 2008\Projects\MyProject\MyProject.csproj
and that project is included in this solution:
then your solution is going to reference your project with a path like this:
Code: Select all
..\Documents and Settings\Joe\My Documents\Visual Studio 2008\Projects\MyProject\MyProject.csproj
This will obviously only work for Joe. Or for everybody who happens to log onto their machine as Joe.
If you're using a web site project, and you can't figure out how to correct this problem,
the next FAQ has suggestions specific to web site projects.