JetBrains Rider中UWP运行失败报错代码1及清单URI未注册问题
解决JetBrains Rider中UWP项目运行失败(错误代码1)及Manifest命名空间未注册问题
一、修复Package.appxmanifest命名空间未注册问题
Rider默认未自动识别UWP Manifest的Schema文件,需手动导入:
- 打开Rider设置:
File > Settings(Windows/Linux)或Rider > Settings(Mac) - 导航到
Languages & Frameworks > Schemas and DTDs > External Schemas - 点击
+按钮,分别添加对应命名空间的Schema文件:- 对应
http://schemas.microsoft.com/appx/manifest/foundation/windows10:找到Visual Studio安装目录下的FoundationManifestSchema.xsd,典型路径为C:\Program Files (x86)\Windows Kits\10\Xml\Schema\FoundationManifestSchema.xsd - 对应
http://schemas.microsoft.com/appx/2014/phone/manifest:添加同目录下的PhoneManifestSchema.xsd - 对应
http://schemas.microsoft.com/appx/manifest/uap/windows10:添加同目录下的UapManifestSchema.xsd
- 对应
- 保存设置后重启Rider
二、解决运行失败(错误代码1)问题
1. 检查运行配置
- 打开
Run > Edit Configurations,选中你的UWP项目配置:- 确认目标设备(本地机器/模拟器)设置正确
- 包签名选项:勾选
Sign the package,选择有效的证书或生成临时证书 - 确保项目目标Windows版本与Rider支持的SDK版本匹配
2. 清理重建项目
- 删除项目根目录下的
bin和obj文件夹 - 在Rider中执行
Build > Clean Solution,随后执行Build > Rebuild Solution
3. 统一Windows SDK版本
- 打开Rider设置,导航到
Build, Execution, Deployment > Toolset and Build - 确认
Windows SDK Version选择与Visual Studio中一致的版本(例如10.0.19041.0)
4. 重置Rider缓存(最后尝试)
- 执行
File > Invalidate Caches...,选择Invalidate and Restart,清除Rider的缓存文件后重启
内容的提问来源于stack exchange,提问作者Sunrise987
相关产品推荐
相关产品推荐

