Question

I'm having trouble making commits to/updating from the SVN repository I set up the other day on my network drive (one of these) at home.

I'm referring to the repository using the url:

file://mynetworkdrive/Documents/subversion/code/sln/trunk/MyWebsite/trunk/Home

When I select either of the Update or Commit options from the Solution context menu in VS 2010 I get a dialog window displaying the exception shown below:

enter image description here

SharpSvn.SvnRepositoryIOException: Commit failed (details follow): ---> SharpSvn.SvnRepositoryIOException: Unable to connect to a repository at URL 'file://mynetworkdrive/Documents/subversion/code/sln/trunk/MyWebsite/trunk/Home' ---> SharpSvn.SvnRepositoryIOException: Unable to open an ra_local session to URL ---> SharpSvn.SvnRepositoryIOException: Unable to open repository 'file://mynetworkdrive/Documents/subversion/code/sln/trunk/MyWebsite/trunk/Home' ---> SharpSvn.SvnSystemException: Can't open file '\\mynetworkdrive\Documents\subversion\code\sln\trunk\MyWebsite\trunk\Home\format': Logon failure: unknown user name or bad password.  
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
   at SharpSvn.SvnClientArgs.HandleResult(SvnClientContext client, SvnException error, Object targets)
   at SharpSvn.SvnClientArgs.HandleResult(SvnClientContext client, svn_error_t* error, Object targets)
   at SharpSvn.SvnClient.Commit(ICollection`1 paths, SvnCommitArgs args, SvnCommitResult& result)
   at Ankh.Services.PendingChanges.PendingChangeHandler.<>c__DisplayClass1b.<Commit_CommitToRepository>b__19(Object sender, ProgressWorkerArgs e)

When I first set this up I could communicate with the repository fine from within Visual Studio.

I can browse the contents of the network drive using windows explorer.

I can use TortoiseSVN outside of Visual Studio to update or commit to my repository.

However, this is a pain, I want to have the Ankhsvn integration with Visual Studio available to use.

It seems as though Visual Studio has forgotten the username/password that it needs to access the URL. I can't find a way to replace or force a prompt for credentials.

I also changed to running Visual Studio 2010 as Administrator so that I could work with IIS 7, I wondered if that had something to do with it?

Was it helpful?

Solution

Rewriting my answer with the knowledge from the comments to my original response.

You run your Visual Studio with administrative priviliges. This makes the application (VS) run in its own session, which has its own network mappings. Subversion then tries to connect to the file:/// repository using a network mapping that isn't created yet.

The solution in this case is to ensure the network mapping also exists for this administrative user. You can do this by browsing to the folder via File->Open and then passing the credentials.

Another option would be to create a batch file that creates the network mappings (net add) and then starts Visual Studio. This would avoid re-applying the same trick every time.

Another option would be to connect to a Subversion server over http(s) or svn://.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top