Question

I have console application. In that I am taking copy of my svn project.my code is:

System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;

startInfo.FileName = @"c:\windows\system32\cmd.exe";
startInfo.Arguments = @"C:\Program Files (x86)\VisualSVN Server\bin\svnadmin dump E:\Repositories\Test > E:\AFS\AFS.Schedule.VisualSVN\TestFolder\Dest\Test\NewTest.dump";

startInfo.Verb = "runas";

process.StartInfo = startInfo;
process.Start();

process.WaitForExit();

Issue is: I am able to create a dump file. But size is 0kb.

let me know what i m missing.

Était-ce utile?

La solution

Paths in your code are invalid.

The wrong string is:

startInfo.Arguments = @"C:\Program Files (x86)\VisualSVN Server\bin\svnadmin dump E:\Repositories\Test > E:\AFS\AFS.Schedule.VisualSVN\TestFolder\Dest\Test\NewTest.dump";

The correct string is:

startInfo.Arguments = @""C:\Program Files (x86)\VisualSVN Server\bin\svnadmin.exe" dump E:\Repositories\Test > E:\AFS\AFS.Schedule.VisualSVN\TestFolder\Dest\Test\NewTest.dump";

Note the missing .exe and quotation.

Autres conseils

Make sure your standard command prompt has a reference to the PATH it requires:

In your case C:\Program Files (x86)\VisualSVN Server\bin;

Here are some instructions on how to edit your PATH variable from within Windows.

Explanation:

The problem is that your Environment PATHs are setup incorrectly, so that in the context that your application is running, it's not able to reference the correct paths to your Visual SVN installation, it's probably trying to access another version of Subversion on your machine.

To test this theory, open a cmd prompt through the VisualSVN Server Managment App (this will temporarily add the correct PATH variable) : VisualSVN Server > Actions > All Task > Start Command Prompt

(make sure you've selected the top level item in the navigation and not a repository in the tree or you wont get the option in the All Tasks menu)

This should dump a complete backup of that repo.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top