Windows 10 and Windows Server 2016 introduce solution for the traditional Long Path issue. The solution is straightforward to implement and detailed very good in the following blog post. Following the steps works successfully for a .NET console/desktop application. However, for some reason, when running the same code from a ASP.NET web application I still getting the same classic System.IO.PathTooLongException
exception.
The code that throws exception:
Directory.CreateDirectory(longPath);
As I mention, the code runs successfully on console application, but fails in ASP.NET website application. the website web.config includes the following:
<?xml version="1.0"?>
<configuration>
<runtime>
<AppContextSwitchOverrides value="Switch.System.IO.UseLegacyPathHandling=false;Switch.System.IO.BlockLongPaths=false"/>
</runtime>
</configuration>
and application manifest file as explained in the blog link above.
Any idea appreciated.