我创建了一个路径很长的 Xamarin.Forms 项目,在构建它时出现此错误:
"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."
我不能更改我的项目路径和我的项目名称,它必须有特定的名称。
谁能帮助我们找到解决此问题的方法?
谢谢
最佳答案
尝试在您的项目中添加此 msbuild 属性,这将缩短 obj 目录中的文件/文件夹名称
<PropertyGroup>
<UseShortFileNames>True</UseShortFileNames>
</PropertyGroup>
或者将输出文件夹更改为更接近 C:\
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<IntermediateOutputPath>C:\MyFolder\MyProj</IntermediateOutputPath>
</PropertyGroup>
希望对您有所帮助。
关于android - PathTooLongException Xamarin Droid 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42349161/