.NET MAUI部署遇DEP0700错误:缺失Microsoft.VCLibs.140.00框架求助
问题详情
我首次学习.NET MAUI,正在通过微软的训练练习学习XAML。部署应用时遇到以下错误:
Error DEP0700: Registration of the app failed. [0x80073CF3] Windows cannot install package 0A39EF64-0606-4941-8C45-EAB3CF9DE53D_1.0.0.1_x64__9zz4h110yvjzm because this package depends on a framework that could not be found. Provide the framework "Microsoft.VCLibs.140.00" published by "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US", with neutral or x64 processor architecture and minimum version 14.0.24217.0, along with this package to install. The frameworks with name "Microsoft.VCLibs.140.00" currently installed are: {}
我已通过NuGet安装了VCLibs.VCRuntime,但报错指向的是另一个包。目标.NET Runtime为net 8.0,操作系统是Windows Server 2019。
解决方案
- 安装对应版本的Visual C++ Redistributable
报错里的Microsoft.VCLibs.140.00就是微软Visual C++运行时库,需要安装版本14.0.24217.0的x64架构包。完成安装后重新尝试部署应用。 - 检查项目Windows平台配置
右键项目 → 属性 → Windows设置,确认目标平台版本和最小版本与Windows Server 2019兼容,同时将目标架构设置为x64(与报错中的包架构匹配)。 - 清理重建项目
- 删除项目目录下的
bin和obj文件夹 - 在Visual Studio中执行「生成」→「清理解决方案」
- 重新生成解决方案后再进行部署
- 删除项目目录下的
- 更新Windows Server 2019
确保系统安装了最新的累积更新,部分依赖组件需要系统更新支持才能正常注册。
内容的提问来源于stack exchange,提问作者N. Tanaka

