Weird Windows Error: The File Already Exists

I ran into a very strange Windows error a while back. It started when I tried to make a commit in GitHub for Windows and got an error message....

June 4, 2015 · 2 min · Nick Spreitzer

C# UNC Path

For some odd reason, System.IO doesn’t include a method to get the UNC path for a file or directory. Even stranger, many code samples resort to using p/invoke in order to get that information. But then I came across this StackOverflow answer that explained a pure .NET way to do the same thing. I gave the original code a good refactoring and turned it into the extension method below. While the most obvious place to stick something like this is the Path class, since it’s static that’s not possible....

May 20, 2013 · 1 min · Nick Spreitzer