Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 901
Grokodile Avatar asked Mar 09 '13 13:03

Grokodile


People also ask

Does AnkhSVN work with Visual Studio 2008/2010/2012?

When it is the default SCC provider it should automatically detect that your (C# ?) website project is already in Subversion. Show activity on this post. If you are using Express Versions of Visual Studio 2008/2010/2012, note that AnkhSVN does not work with Express versions.

Why VisualSVN for subversion?

Unbeatable reliability: Visual Studio will never crash or hang because of VisualSVN. Seamless integration: VisualSVN automatically handles added or renamed files and reflects these operations to Subversion. Real-time status: VisualSVN carefully tracks and displays all the current changes made to your working copy.

What is AnkhSVN?

The 100% Opensource Source Code Management Solution for Microsoft Visual Studio. AnkhSVN is a Subversion SourceControl Provider for Visual Studio. The software allows you to perform the most common version control operations directly from inside the Microsoft Visual Studio IDE.

Will Visual Studio ever crash or hang due to visual SVN?

All Subversion operations are performed out of the Visual Studio process. Common operations such as Commit or Update are performed using the TortoiseSVN dialogs. Other unmanaged code is executed in a pool of separate worker processes. This out-of-process model provides the proof that Visual Studio will never crash or hang because of VisualSVN.


1 Answers

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

like image 194
Bert Huijben Avatar answered Sep 27 '22 22:09

Bert Huijben