.NET MAUI中DEP0700启动屏错误的解决与根源排查
.NET MAUI DEP0700错误:启动屏图片缺失的根源与彻底解决方法
错误详情
DEP0700: Registration of the app failed. [0x80073CF6] AppxManifest.xml(33,27): error 0x80070003: Cannot install or update package C2825F9A-1C95-43C1-96C9-3ABE72D02D1D_9zz4h110yvjzm because the splash screen image [splashSplashScreen.png] cannot be located. Verify that the package contains an image that can be used as a splash screen for the application, and that the package manifest points to the correct location in the package where this splash screen image can be found.
问题根源
- 核心原因是清理bin/obj目录后,.NET MAUI的资源构建流程未正确触发,导致启动屏图片未被处理并复制到Appx包的指定位置。
- 增量构建逻辑可能跳过了
GenerateMauiSplashScreen目标,使得重新生成时资源未被纳入输出包。 - 图片的Build Action配置错误或csproj中资源定义路径不匹配,也会导致清理后资源无法被正确识别。
彻底解决步骤
1. 验证启动屏图片的Build Action
右键项目中的splashSplashScreen.png文件 → 属性:
- Build Action必须设置为
MauiSplashScreen - Copy to Output Directory设置为
Do not copy(MAUI自动处理资源复制,手动设置会引发冲突)
2. 修正csproj中的资源定义
打开项目的.csproj文件,确认启动屏资源配置路径与实际文件位置一致,无重复或错误定义:
<MauiSplashScreen Include="Resources\Splash\splashSplashScreen.png" />
注意:Windows平台对文件路径大小写敏感,确保路径大小写与实际文件完全匹配
3. 强制完全重新构建
避免增量构建跳过资源生成步骤,执行以下操作:
- 在Visual Studio中:生成 → 清理解决方案 → 生成 → 重新生成解决方案
- 或使用命令行(管理员权限):
dotnet clean dotnet build -c Debug --no-incremental
4. 确认自动生成的AppxManifest.xml路径
不要手动修改obj目录下自动生成的AppxManifest.xml,该文件由MAUI根据csproj配置生成。若其中启动屏路径错误,回到步骤2修正csproj的资源定义。
5. 禁用增量构建缓存(可选)
若问题频繁出现,可关闭Visual Studio的增量构建:
- 工具 → 选项 → 项目和解决方案 → 生成并运行 → 取消勾选启用增量构建
注:此操作会增加构建时间,仅在必要时使用
内容的提问来源于stack exchange,提问作者Quentin Guillaume
相关产品推荐
相关产品推荐

