Resolve System.IO.PathTooLongException [Sharepoint C# .Net]

The specified path, file name, or both are too long. 
The fully qualified file name must be less than 260 characters, 
and the directory name must be less than 248 characters.

If you are using Windows 10 this issue of "Maximum Path Length Limitation" can be resolved by setting LongPathsEnabled value to 1 by the below powershell command.

New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force





#Sharepoint #cSharp #dotNet

Have Questions? Post them here!

Recent Posts:

Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and Software Developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include Learnings, Video Tutorials, Code Snippets, How Tos, Blogs, Articles, etc.