I Created a Xamarin.Forms project with a long path, and while building it I get this error:
"System.IO.PathTooLongException: 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."
I can't change my project path neither my project name, it has to have that specific name.
Can any one help we find a workaround this problem please?
Thanks
Try adding this msbuild property in your project that will shorten the file/folder names on the obj directory
<PropertyGroup>
<UseShortFileNames>True</UseShortFileNames>
</PropertyGroup>
Or this to change the output folder to a one closer to the C:\
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<IntermediateOutputPath>C:\MyFolder\MyProj</IntermediateOutputPath>
</PropertyGroup>
Hope it helps.
Probably the easiest temporary solution is to move your project to a drive's root folder to decrease the length of the path.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With