I have some code that has begun to throw the exception: TooLongPathException. So I did some research and found out that .net 4.6.2 solves this problem. Great!
The code that fails is code that moves and copies folders to different folders. I would like to use .net 4.6.2 framework to enable this code to use longer paths so I do not need to code some workaround.
I have installed .net 4.6.2 framework on the machine. The machine runs Windows server 2008 R2 SP1. I have made the project target 4.6.2 framwork but still it throws this error.
I am not sure what I am missing here.
Has anyone used .net 4.6.2 for a similar thing that can point me as to what I need to do?
After a zillion of Tests I can confirm that this works with .Net 4.6.2 on a Windows10, but fails on a Server 2012r2.
When i want to delete a long folder that i created with Windows10 on a share, the Server is failing to delete it. My workaround is the old fashioned Robocopy.
I think that Microsoft should make "Enable Win32 long paths" policy available to Server 2012 (and maybe even 2008) a soon as possible. Sorry, but right now this looks bad.