android - PathTooLongException Xamarin Droid 项目

标签 android xamarin xamarin.droid

我创建了一个路径很长的 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/

相关文章:

android - 为什么 visual studio 存档总是失败

android - Koin 将 View 模型注入(inject) Composable

Android - SeekBar 起点

java - 为仅在第二个 fragment 之后显示的页面查看器添加指示器?

android - Android中的Xamarin蓝牙连接失败

xamarin - 使用 MvvmCross Droid 自定义动画

android - Umano SlidingUpPanel 上滑后顶部面板消失

android - 如何验证 Xamarin/Android 应用程序中的字段

ios - UITableView UITableViewCellStyle.Value1 TextLabel与DetailTextLabel重叠

c# - Xamarin 可移植 .NETStandard 1.5 单元测试