File.Replace(patchCraftDataPath + @"Temp\PatchCraft.ptch", path, patchCraftDataPath + @"Temp\PatchCraft.old");
path is equal to "C:\\Users\\<Name>\\Documents\\Visual Studio 2010\\Projects\\PatchCraft\\PatchCraft\\bin\\Debug\\PatchCraft.exe"
When I run the binary, I run it in this folder: "C:\Users\<Name>\Documents\PatchCraft\Publish\PatchCraft"
Thus, the filepath argument my patcher gets and in turn the path var should be: C:\\Users\\<Name>\\Documents\\PatchCraft\\Publish\\PatchCraft\\PatchCraft.exe"
My exception text when I run the binary:
************** Exception Text **************
System.ArgumentException: The path is not of a legal form.
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength)
at System.IO.Path.GetFullPathInternal(String path)
at System.IO.File.InternalReplace(String sourceFileName, String destinationFileName, String destinationBackupFileName, Boolean ignoreMetadataErrors)
at System.IO.File.Replace(String sourceFileName, String destinationFileName, String destinationBackupFileName)
at PatchCraft_Patcher.PatchCraftPatcher.PatchDownloadComplete(Object sender, AsyncCompletedEventArgs e)
at System.Net.WebClient.OnDownloadFileCompleted(AsyncCompletedEventArgs e)
at System.Net.WebClient.DownloadFileOperationCompleted(Object arg)
Why is the binary counting the path variable as invalid?