Blogged: [HOWTO] Using Path.Combine correctly to ensure cross-platform compatibility
[HOWTO] Using Path.Combine correctly to ensure cross-platform compatibility
I guess every .NET developer is familiar with the Path.Combine method. But, is every .NET developer using it correctly to ensure its result is cross-platform compatible? I guess no as I was one of these developers who didn't use it correctly. Did you ever see something like this? var arbitraryPath = Path.GetFullPath( Path.Combine( AppContext.BaseDirectory, @"..\..\..\..\ArbitraryDirectory" ) ); This works flawlessly on Windows.
blog.rufer.be