sharpsvn

Cannot delete file using SharpSvn: {filepath} is not a working copy


I am unable to delete a file from SVN using SharpSvn.

Here is my code:

using (SvnClient client = new SvnClient())
{
    // snip...
    string filePath = "C:\\path\\to\\file.txt";
    client.Delete(filePath, deleteArgs);
}

Here is the exception:

SharpSvn.SvnInvalidNodeKindException: ''C:\path\to\file.txt' is not a working copy'

I confirmed this filepath exists and is tied to SVN. What is the problem?


Solution

  • This question led me to the answer. I was using the incorrect casing in my filepath. Following the example above, maybe I tried to delete the file "C:\path\to\file.txt" but the actual path on disk was "C:\PATH\TO\file.txt". I fixed by using SvnTools.GetTruePath:

    client.Delete(SvnTools.GetTruePath(filePath), deleteArgs);