【问题标题】:Runtime identifier for a device architecture must be specified in order to publish this project (.NET MAUI)必须指定设备体系结构的运行时标识符才能发布此项目 (.NET MAUI)
【发布时间】:2023-01-15 05:20:17
【问题描述】:

嗨,我想知道为什么当我尝试发布到 iOS Image 时会收到此错误设置已经是这样的

我错过了什么吗?

<TargetFrameworks>net6.0-ios</TargetFrameworks>

<PropertyGroup Condition="$(TargetFramework.Contains('-ios')) and '$(Configuration)' == 'Release'">
        <RuntimeIdentifier>ios-arm64</RuntimeIdentifier>
        <!-- Only needed when you have a need for entitlements -->
        <!-- <CodesignEntitlement>Entitlements.plist</CodesignEntitlement> -->
        <CodesignKey>Apple Distribution: SAMPLE DISTRIBUTION (8C4ZRPEBJP)</CodesignKey> <!-- Should be your Certificate Distribution-->
        <CodesignProvision>MauiShellApplication</CodesignProvision>
        <ArchiveOnBuild>true</ArchiveOnBuild>
    </PropertyGroup>

【问题讨论】:

  • 你在运行什么命令?您的项目有项目参考吗?
  • 嗨@GeraldVersluis 我正在运行一个 dotnet 发布版本
  • 我想 ;) 我的意思是包含所有参数的完整命令和对以下问题的回答:您的项目是否有任何对其他类库的项目引用?如果是这样,您必须在 dotnet publish 命令中明确指定 .NET MAUI 应用程序的 csproj
  • 当我关闭 visual studio 时,Dotnet publish 命令不再给我错误。

标签: maui


【解决方案1】:

我不得不删除应用程序文件夹根目录下的 [PROJECT].csproj.user 文件。我以前遇到过这个问题,但完全忘记了。该文件似乎正在获取覆盖主 csproj 文件的设置,并且在属性更改时不会更新。希望这可以节省其他人我找到记住问题所花费的时间!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-18
    • 1970-01-01
    • 2022-10-15
    • 1970-01-01
    • 2022-10-07
    • 1970-01-01
    相关资源
    最近更新 更多