mac arm 调试 maui 提示 iOS 构建没有“net8.0-ios/iossimulator-x64”的目标
在 arm 芯片 mac 调试, 使用 mac for vs ,出现以下错误
obj/project.assets.json”没有“net8.0-ios/iossimulator-x64”的目标。确保已运行还原,且“net8.0-ios”已包含在项目的 TargetFrameworks 中。可能需要在项目 RuntimeIdentifiers 中包括“iossimulator-x64”。 (NETSDK1047) (xxx.Maui)
obj/project.assets.json’ doesn’t have a target for ‘net7.0-ios/ios-arm64’. Ensure that restore has run and that you have included ‘net7.0-ios’ in the TargetFrameworks for your project. You may also need to include ‘ios-arm64’ in your project’s RuntimeIdentifiers. (NETSDK1047) (xxx.PDSX)
原因
iOS 构建需要显式定义的 RuntimeIdentifier 值“iossimulator-x64”、“iossimulator-arm64”或“ios-arm64”
编辑项目文件添加以下这行
<RuntimeIdentifier Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios' and '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'arm64'">iossimulator-arm64</RuntimeIdentifier>
Enjoy!
关联项目
FreeSql QQ群:4336577
BA & Blazor QQ群:795206915
Maui Blazor 中文社区 QQ群:645660665
知识共享许可协议
本作品采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可。欢迎转载、使用、重新发布,但务必保留文章署名AlexChow(包含链接: https://github.com/densen2014 ),不得用于商业目的,基于本文修改后的作品务必以相同的许可发布。如有任何疑问,请与我联系 。
转载声明
本文来自博客园,作者:周创琳 AlexChow,转载请注明原文链接:https://www.cnblogs.com/densen2014/p/18016497
AlexChow
今日头条 | 博客园 | 知乎 | Gitee | GitHub