Ankhsvn integrated in Visual Studio 2010 can't connect to SVN repo on network drive
Asked Answered
B

1

6

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?

Budding answered 9/3, 2013 at 13:23 Comment(0)
R
4

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://.

Revolt answered 12/3, 2013 at 13:5 Comment(6)
I'm not sure if my question was unclear, I've edited to make it clearer hopefully. I'm developing in Visual Studio and running my website on IIS 7 locally. The only point at which I do anything over the network at present is when I interact with my repository. This is located on a standalone network drive, I'm not sure if I can set it up to work with an "http://" repository URL?Budding
Are you running your visual studio as administrator (via elevation or run as)?Revolt
Another thing you could try is first opening '\\mynetworkdrive\Documents' in file->open, before trying to access file://mynetworkdrive/documents via AnkhSVN.Revolt
I've configured the VS shortcut to run as Administrator, I'll give the file -> open idea a try this evening, thanksBudding
Haha, so simple it had to work! File -> open, prompted for credentials, able to commit again! Genius. If you could edit that suggestion in as your answer, then I shall duly accept.Budding
Move my repository today so that I could share between machines. I have it on a mapped drive on my main machine, connecting through my laptop. I could not figure out the commit problem until I found this. I can get the commit to work by not running as admin, or by doing the "file | open" on the mapped drive. Thanks MuchUlrikeulster

© 2022 - 2024 — McMap. All rights reserved.