views:

639

answers:

2

Scenario:

I'm using svn:externals to grab Microsoft.Practices.ServiceLocation from CodePlex. However, referencing the csproj-file in my own project causes an upgrade from 2005 to 2008. This makes my copy of the project file different from the base copy, and I am unable to update the project from subversion.

An update of ...\deps\Microsoft.Practices.ServiceLocation results in:

Command          Update
Tree conflict    ...\deps\Microsoft.Practices.ServiceLocation\ServiceLocatorProvider.cs
Tree conflict    ...\deps\Microsoft.Practices.ServiceLocation\ServiceLocatorImplBase.cs
Tree conflict    ...\deps\Microsoft.Practices.ServiceLocation\ServiceLocator.cs
Tree conflict    ...\deps\Microsoft.Practices.ServiceLocation\Readme.txt
Tree conflict    ...\deps\Microsoft.Practices.ServiceLocation\Properties
Tree conflict    ...\deps\Microsoft.Practices.ServiceLocation\Microsoft.Practices.ServiceLocation.csproj
Tree conflict    ...\deps\Microsoft.Practices.ServiceLocation\IServiceLocator.cs
Tree conflict    ...\deps\Microsoft.Practices.ServiceLocation\ActivationException.Desktop.cs
Tree conflict    ...\deps\Microsoft.Practices.ServiceLocation\ActivationException.cs
Completed        At revision: 43682
warning!         One or more files are in a conflicted state.

An update of ...\deps results in:

Command          Update
Completed        At revision: 0

An update of the root results in:

Command           Update
External          ...\deps\Microsoft.Practices.ServiceLocation
External failed   ...\deps\Microsoft.Practices.ServiceLocation
Error             Working copy '...\deps\Microsoft.Practices.ServiceLocation' locked
Error             Please execute the 'Cleanup' command.
Completed         ...\deps\Microsoft.Practices.ServiceLocation - at revision: 0

The messing claiming that the working copy is locked seems to be wrong, executing Release lock on the Microsoft.Practices.ServiceLocation folder results in a message stating "There's nothing to unlock. No file has a lock in this working copy." Same result if I execute the command at the root.

Executing a cleanup changed nothing.

I'm using TortoiseSVN.

  1. Can I tell Visual Studio 2008 to treat a project/directory as readonly to avoid an upgrade?
  2. Is there a secret Subversion command I can execute to get this to work?
  3. Why does an update of files that havnt changed cause a tree conflict?

Edit: I've googled some, and found the Subversion documentation explaining tree conflicts at http://svnbook.red-bean.com/nightly/en/svn.tour.treeconflicts.html. I changed my third question since I dont understand why I'm getting a tree conflict when updating files that havnt changed.

+1  A: 

Visual Studio 2008 will quite happily open a read-only solution (this is the normal, non-checked-out usage).

But VS2008 can't open VS 2005 solution files, so it always tries to upgrade. You seem to be looking for a way to open a 2005 solution in 2008 without the upgrade, and I don't think this is possible.

Either get a copy of VS 2005 (this could be an Express edition), or get the Codeplex project as a whole to upgrade (remembering that VS 2008 will target .NET 2.0).

Richard
If I were to install Visual Studio 2005 (non-express), would it integrate into the same environment and let me open the project without upgrading? (Like having two "project-engines" active in the same devenv.exe process?)
Simon Svensson
I don't know about SNV integration, but each side by side version of VS has its own separate configuration (e.g. with Team Foundation client, there is a separate client install for each version of VS).
Richard
+2  A: 

There are several options depending on how involved you are with the project and if you will be changing it.

For a project I am primarily using for the libraries I do not put the open-source projects into my solution - just the dll's which I keep in my source control repository in a libraries folder.

When you are debugging you can step into the code of the library in VS2008 without actually opening the 2005 project file; so no update is necessary.

When I do need to work on the code for the opensource library I open it in it's own solution. If it needs to update to vs2008 I let it - it is not a big deal as only the project files get changed - not the source code. Since it is in source control you can always revert the project files to the originals or rename your new copies and keep 2 csproj files side by side.

I only do a svn-update with tortoise on the open-source projects and do not get conflicts. Svn will merge any changes into my copy. If I have changes that are needed for the open-source project I submit a patch and do not commit from my copy.

If this is a project that you are an active developer and the other team members need to stay in VS2005 then you could load VS2005 side-by side without issue. I have had 4-5 copies of VS installed on the same machine - the only downside is disk space.

It sounds like you may need to do a fresh checkout of the project into a new folder if you have too many conflicts. Then you can use a good diff tool to resolve the conflicts manually - I use WinMerge.

Maggie