xamarin.shared.sdk.targets(366,3)MessagingRemoteexception,ExcregateException和NotimplempledException

发布于 2025-02-04 10:02:20 字数 6749 浏览 3 评论 0 原文

我正在运行此命令

dotnet publish -f:net6.0-ios -c:Release

来构建.NET MAUI应用程序,并为iOS创建 .IPA文件( .csproj in end)

,我会收到此错误:

c:\ program 文件\ dotnet \ packs \ microsoft.ios.sdk \ 15.4.303 \ targets \ xamarin.shared.sdk.targets(366,3): 错误: MessagingRemoteexception :客户端构建时发生了错误 在执行主题XVS/build/execute-task/onesiemobile/的回复时/ 18E8F3C002FMergeAppbundles [c:\ development_buildPipeline \ onesiemobile \ onesiemobile \ onesiemobile.csproj]

c:\ program 文件\ dotnet \ packs \ microsoft.ios.sdk \ 15.4.303 \ targets \ xamarin.shared.sdk.targets(366,3): 错误: ExcregateException :发生一个或多个错误。 (方法 或未实施操作。)[C:\ developtim_buildPipeline \ ans iemobile \ onesiemobile \ onesiemobile.csproj]

c:\ program 文件\ dotnet \ packs \ microsoft.ios.sdk \ 15.4.303 \ targets \ xamarin.shared.sdk.targets(366,3): 错误: notimplemplededexception :方法或操作不是 实施的。 [c:\ development_buildPipeline \ onesiemobile \ onesiemobile \ ans iemobile.csproj]

c:\ program 文件\ dotnet \ packs \ microsoft.ios.sdk \ 15.4.303 \ targets \ xamarin.shared.sdk.targets(366,3): 错误:[c:\ develo pment_buildPipeline \ onesiemobile \ onesiemobile \ onesiemobile.csproj]

我能够成功地使用Demo .Net Maui应用程序,将iPhone的整个应用程序与Visual Studio 2022中的模板随附的Demo .NET Maui应用程序整个过程。

我也有能力。要克隆并发布此项目一直到我的iPhone。

所以我以为我开始从事自己​​的项目。

  • 当我按“ Visual Studio”中的“播放”按钮并将其作为Windows应用程序在调试器中的Windows应用程序中运行时,它的功能也很棒,
  • 它在云Mac的远程iOS模拟器上也可以通过我的机器上的Visual Studio运行。 (虽然需要15分钟的时间来启动它!)

环境:
Windows 10 Home,21H2
vs 2022版本17.3.0预览1.1

<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
        <TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
        <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
        <!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
        <!-- <TargetFrameworks>$(TargetFrameworks);net6.0-tizen</TargetFrameworks> -->
        <OutputType>Exe</OutputType>
        <RootNamespace>OnesieMobile</RootNamespace>
        <UseMaui>true</UseMaui>
        <SingleProject>true</SingleProject>
        <ImplicitUsings>enable</ImplicitUsings>

        <!-- Display name -->
        <ApplicationTitle>OnesieMobile</ApplicationTitle>

        <!-- App Identifier -->
        <ApplicationId>com.maui.app</ApplicationId>
        <ApplicationIdGuid>447A62C6-2841-41D6-B9AE-444E6E1A908B</ApplicationIdGuid>

        <!-- Versions -->
        <ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
        <ApplicationVersion>1</ApplicationVersion>

        <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
        <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
        <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
        <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
        <TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
        <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
    </PropertyGroup>
    
    <PropertyGroup Condition="$(TargetFramework.Contains('-ios')) and '$(Configuration)' == 'Release'">
        <RuntimeIdentifiers>ios-arm64</RuntimeIdentifiers>
        <CodesignProvision>Maui Provisioning</CodesignProvision>
        <CodesignKey>Apple Distribution: My Name (XXXX)</CodesignKey>

        <ArchiveOnBuild>true</ArchiveOnBuild>
        <TcpPort>58181</TcpPort>
        <ServerAddress>xxxxx</ServerAddress>
        <ServerUser>xxxx</ServerUser>
        <ServerPassword>xxxx</ServerPassword>
        <_DotNetRootRemoteDirectory>/Users/xxxx/Library/Caches/Xamarin/XMA/SDKs/dotnet/</_DotNetRootRemoteDirectory>

    </PropertyGroup>

    <ItemGroup>
        <!-- App Icon -->
        <MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />

        <!-- Splash Screen -->
        <MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />

        <!-- Images -->
        <MauiImage Include="Resources\Images\*" />
        <MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />

        <!-- Custom Fonts -->
        <MauiFont Include="Resources\Fonts\*" />

        <!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
        <MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
    </ItemGroup>

    <ItemGroup>
      <PackageReference Include="CommunityToolkit.Maui" Version="1.0.0" />
      <PackageReference Include="CommunityToolkit.Mvvm" Version="7.1.2" />
      <PackageReference Include="sqlite-net-pcl" Version="1.8.116" />
    </ItemGroup>

    <ItemGroup>
      <Compile Update="View\ActivityDetailPage.xaml.cs">
        <DependentUpon>ActivityDetailPage.xaml</DependentUpon>
      </Compile>
    </ItemGroup>

    <ItemGroup>
      <MauiXaml Update="View\ActivityDetailPage.xaml">
        <Generator>MSBuild:Compile</Generator>
      </MauiXaml>
      <MauiXaml Update="View\SettingsPage.xaml">
        <Generator>MSBuild:Compile</Generator>
      </MauiXaml>
    </ItemGroup>

</Project>

I am running this command

dotnet publish -f:net6.0-ios -c:Release

to build a .NET MAUI App and create the .ipa file for iOS (.csproj at the end)

and I get this error:

C:\Program
Files\dotnet\packs\Microsoft.iOS.Sdk\15.4.303\targets\ Xamarin.Shared.Sdk.targets(366,3) :
error : MessagingRemoteException: An error occurred on client Build
while executing a reply for topic xvs/build/execute-task/OnesieMobile/
18e8f3c002fMergeAppBundles
[C:\Development_BuildPipeline\OnesieMobile\OnesieMobile\OnesieMobile.csproj]

C:\Program
Files\dotnet\packs\Microsoft.iOS.Sdk\15.4.303\targets\ Xamarin.Shared.Sdk.targets(366,3) :
error : AggregateException: One or more errors occurred. (The method
or operation is not implemented.) [C:\Development_BuildPipeline\Ones
ieMobile\OnesieMobile\OnesieMobile.csproj]

C:\Program
Files\dotnet\packs\Microsoft.iOS.Sdk\15.4.303\targets\ Xamarin.Shared.Sdk.targets(366,3) :
error : NotImplementedException: The method or operation is not
implemented.
[C:\Development_BuildPipeline\OnesieMobile\OnesieMobile\Ones
ieMobile.csproj]

C:\Program
Files\dotnet\packs\Microsoft.iOS.Sdk\15.4.303\targets\Xamarin.Shared.Sdk.targets(366,3):
error : [C:\Develo
pment_BuildPipeline\OnesieMobile\OnesieMobile\OnesieMobile.csproj]

I was able to successfully do the whole process of publishing an app all the way to my IPhone with the demo .NET MAUI application that comes with the template in Visual Studio 2022.

I was also able to clone and publish this project https://github.com/jfversluis/dotnet-maui-workshop/tree/main/Part%202%20-%20MVVM all the way to my IPhone.

So I thought I start working on my own project.

  • It works great when I press the play button in Visual Studio and run it as Windows App on my Windows in the debugger
  • It also works great on the remote iOS simulator in the cloud Mac through Visual Studio on my machine. (Although it takes 15 Minutes to fire it up!)

Environment:
Windows 10 Home, 21H2
VS 2022 Version 17.3.0 Preview 1.1

<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
        <TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
        <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
        <!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
        <!-- <TargetFrameworks>$(TargetFrameworks);net6.0-tizen</TargetFrameworks> -->
        <OutputType>Exe</OutputType>
        <RootNamespace>OnesieMobile</RootNamespace>
        <UseMaui>true</UseMaui>
        <SingleProject>true</SingleProject>
        <ImplicitUsings>enable</ImplicitUsings>

        <!-- Display name -->
        <ApplicationTitle>OnesieMobile</ApplicationTitle>

        <!-- App Identifier -->
        <ApplicationId>com.maui.app</ApplicationId>
        <ApplicationIdGuid>447A62C6-2841-41D6-B9AE-444E6E1A908B</ApplicationIdGuid>

        <!-- Versions -->
        <ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
        <ApplicationVersion>1</ApplicationVersion>

        <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
        <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
        <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
        <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
        <TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
        <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
    </PropertyGroup>
    
    <PropertyGroup Condition="$(TargetFramework.Contains('-ios')) and '$(Configuration)' == 'Release'">
        <RuntimeIdentifiers>ios-arm64</RuntimeIdentifiers>
        <CodesignProvision>Maui Provisioning</CodesignProvision>
        <CodesignKey>Apple Distribution: My Name (XXXX)</CodesignKey>

        <ArchiveOnBuild>true</ArchiveOnBuild>
        <TcpPort>58181</TcpPort>
        <ServerAddress>xxxxx</ServerAddress>
        <ServerUser>xxxx</ServerUser>
        <ServerPassword>xxxx</ServerPassword>
        <_DotNetRootRemoteDirectory>/Users/xxxx/Library/Caches/Xamarin/XMA/SDKs/dotnet/</_DotNetRootRemoteDirectory>

    </PropertyGroup>

    <ItemGroup>
        <!-- App Icon -->
        <MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />

        <!-- Splash Screen -->
        <MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />

        <!-- Images -->
        <MauiImage Include="Resources\Images\*" />
        <MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />

        <!-- Custom Fonts -->
        <MauiFont Include="Resources\Fonts\*" />

        <!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
        <MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
    </ItemGroup>

    <ItemGroup>
      <PackageReference Include="CommunityToolkit.Maui" Version="1.0.0" />
      <PackageReference Include="CommunityToolkit.Mvvm" Version="7.1.2" />
      <PackageReference Include="sqlite-net-pcl" Version="1.8.116" />
    </ItemGroup>

    <ItemGroup>
      <Compile Update="View\ActivityDetailPage.xaml.cs">
        <DependentUpon>ActivityDetailPage.xaml</DependentUpon>
      </Compile>
    </ItemGroup>

    <ItemGroup>
      <MauiXaml Update="View\ActivityDetailPage.xaml">
        <Generator>MSBuild:Compile</Generator>
      </MauiXaml>
      <MauiXaml Update="View\SettingsPage.xaml">
        <Generator>MSBuild:Compile</Generator>
      </MauiXaml>
    </ItemGroup>

</Project>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

雅心素梦 2025-02-11 10:02:20

弄清楚了。

我不得不更改

<RuntimeIdentifiers>ios-arm64</RuntimeIdentifiers>

<RuntimeIdentifier>ios-arm64</RuntimeIdentifier>

那时。

官方文档给出了单数版本 https:/ 。


dotnet publish

错误
error netsdk1032 PlatformTarget“ X64”必须兼容,这可能是复数形式工作的最初原因。在 *.csproj.user文件中,该值已将其设置为此

<RuntimeIdentifier>iossimulator-x64</RuntimeIdentifier>

,并且由于某些原因,项目设置和命令行参数被 *.csproj.user文件否决,唯一会做某件事的属性是其中一个属性。复数形式。

不幸的是,在所有这些错误之后,我再也无法分辨出来,如果我实际上有一个版本可以使用复数设置发布。 相信我做到了

  • ( 引导我遇到最新的错误,这也不是一个正确的错误,因为它没有以任何可能的原因描述。

总结,删除.csproj.user并将.csproj设置为类似以下内容的功能。然后执行

dotnet publish -f:net6.0-ios -c:Release

<Project Sdk="Microsoft.NET.Sdk">
    
        <PropertyGroup>
            <TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
            <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
            <!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
            <!-- <TargetFrameworks>$(TargetFrameworks);net6.0-tizen</TargetFrameworks> -->
            <OutputType>Exe</OutputType>
            <RootNamespace>OnesieMobile</RootNamespace>
            <UseMaui>true</UseMaui>
            <SingleProject>true</SingleProject>
            <ImplicitUsings>enable</ImplicitUsings>
    
            <!-- Display name -->
            <ApplicationTitle>OnesieMobile</ApplicationTitle>
    
            <!-- App Identifier -->
            <ApplicationId>com.maui.app</ApplicationId>
            <ApplicationIdGuid>447A62C6-2841-41D6-B9AE-444E6E1A908B</ApplicationIdGuid>
    
            <!-- Versions -->
            <ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
            <ApplicationVersion>1</ApplicationVersion>
    
            <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
            <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
            <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
            <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
            <TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
            <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
        </PropertyGroup>
        
        <PropertyGroup Condition="$(TargetFramework.Contains('-ios')) and '$(Configuration)' == 'Release'">
            <RuntimeIdentifier>ios-arm64</RuntimeIdentifier>
            <CodesignProvision>Maui Provisioning</CodesignProvision>
            <CodesignKey>Apple Distribution: My Name (XXXX)</CodesignKey>
    
            <ArchiveOnBuild>true</ArchiveOnBuild>
            <TcpPort>58181</TcpPort>
            <ServerAddress>xxxxx</ServerAddress>
            <ServerUser>xxxx</ServerUser>
            <ServerPassword>xxxx</ServerPassword>
            <_DotNetRootRemoteDirectory>/Users/xxxx/Library/Caches/Xamarin/XMA/SDKs/dotnet/</_DotNetRootRemoteDirectory>
    
        </PropertyGroup>
   
    
    </Project>

Figured it out.

I had to change

<RuntimeIdentifiers>ios-arm64</RuntimeIdentifiers>

to

<RuntimeIdentifier>ios-arm64</RuntimeIdentifier>

then it worked.

The official documentation gives the singular version https://learn.microsoft.com/en-us/dotnet/maui/ios/deployment/overview

The reason why I had changed it, was because of this
Errors with dotnet publish

but then later I also went through this
error NETSDK1032: The RuntimeIdentifier platform 'ios-arm64' and the PlatformTarget 'x64' must be compatible, which was probably the original reason why the plural form worked. In the *.csproj.user file the value was set to this

<RuntimeIdentifier>iossimulator-x64</RuntimeIdentifier>

and since for some reason the project settings and the command line arguments are overruled by the *.csproj.user file, the only property that would do something was the one in the plural form.

Unfortunately I can not tell anymore after all these errors, if I actually had a version that would publish with the plural settings. (I believe I did)

In short:

  • I followed the documentation
  • it was "probably" the *.csproj.user that messed up my configurations
  • which then messed up the inputs I was thinking I was entering
  • which then lead me to the latest error, which is also not a proper error I would say, since it does not describe in any way the probable cause.

To summarize, deleting the .csproj.user and setting the .csproj to something like the following should work. And then execute

dotnet publish -f:net6.0-ios -c:Release

.

<Project Sdk="Microsoft.NET.Sdk">
    
        <PropertyGroup>
            <TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
            <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
            <!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
            <!-- <TargetFrameworks>$(TargetFrameworks);net6.0-tizen</TargetFrameworks> -->
            <OutputType>Exe</OutputType>
            <RootNamespace>OnesieMobile</RootNamespace>
            <UseMaui>true</UseMaui>
            <SingleProject>true</SingleProject>
            <ImplicitUsings>enable</ImplicitUsings>
    
            <!-- Display name -->
            <ApplicationTitle>OnesieMobile</ApplicationTitle>
    
            <!-- App Identifier -->
            <ApplicationId>com.maui.app</ApplicationId>
            <ApplicationIdGuid>447A62C6-2841-41D6-B9AE-444E6E1A908B</ApplicationIdGuid>
    
            <!-- Versions -->
            <ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
            <ApplicationVersion>1</ApplicationVersion>
    
            <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
            <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
            <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
            <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
            <TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
            <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
        </PropertyGroup>
        
        <PropertyGroup Condition="$(TargetFramework.Contains('-ios')) and '$(Configuration)' == 'Release'">
            <RuntimeIdentifier>ios-arm64</RuntimeIdentifier>
            <CodesignProvision>Maui Provisioning</CodesignProvision>
            <CodesignKey>Apple Distribution: My Name (XXXX)</CodesignKey>
    
            <ArchiveOnBuild>true</ArchiveOnBuild>
            <TcpPort>58181</TcpPort>
            <ServerAddress>xxxxx</ServerAddress>
            <ServerUser>xxxx</ServerUser>
            <ServerPassword>xxxx</ServerPassword>
            <_DotNetRootRemoteDirectory>/Users/xxxx/Library/Caches/Xamarin/XMA/SDKs/dotnet/</_DotNetRootRemoteDirectory>
    
        </PropertyGroup>
   
    
    </Project>
穿越时光隧道 2025-02-11 10:02:20

解释
尝试通过安装毛伊岛检查来检查毛伊岛环境。
毛伊岛检查是一种确定您的环境是否准备好毛伊岛开发的工具。虽然您可以专门使用DOT Net CLI安装MAUI,但该工具确保您拥有所有适当的工作负载,以构建目标环境等等。它还将安装毛伊岛应用程序的任何必要模板。

步骤1
打开您的命令提示符窗口。从您的终端登录以下命令:

dotnet工具安装-g redth.net.maui.check

步骤2
安装了MAUI检查后,请从终端运行以下命令:

Maui-Check

过程将将以下依赖项安装到您的环境中:
OpenJDK - 用于构建Android,Android SDK和Emulator和.NET SDK工作负载(Android,MacOS,MacCatalyst,iOS和TVOS)

step 3
最后,在此步骤中,让我们再加上一个WASM工具的工作负载安装。您需要此工作量,因为毛伊岛支持在毛伊岛应用程序中托管大华。
从您的终端运行以下命令:

dotnet工作负载安装wasm-tools

注意:
如果您已经安装了Xcode,OpenJDK和Android SDK的环境依赖性,则可以在终端中运行以下命令来安装必要的工作负载。从您的终端运行以下命令:

我希望这会有所帮助。

Explanation
Try checking your Maui environment by installing MAUI check.
MAUI Check is a tool that determines if your environment is ready for MAUI development. While you could go about installing MAUI using the dot net CLI exclusively, the tool makes sure you have all the appropriate workloads available to build towards a target environment and more. It will also install any necessary templates for MAUI apps.

STEP 1
Open your command prompt window.run the following command from your terminal:

dotnet tool install -g Redth.Net.Maui.Check

STEP 2
Once you have MAUI Check installed, run the following command from your terminal:

maui-check

The process will install the following dependencies into your environment:
OpenJDK – For building Android, Android SDK and Emulator and .NET SDK Workloads for MAUI (Android, macOS, MacCatalyst, iOS, and tvOS)

STEP 3
Finally, in this step, let’s end with one more workload install of WASM tools. You need this workload because MAUI supports hosting Blazor inside a MAUI app.
Run the following command from your terminal:

dotnet workload install wasm-tools

Note:
In case, you already have installed the environmental dependencies of Xcode, OpenJDK, and Android SDK yourself, you can run the following command in a terminal to install the necessary workloads. Run the following command from your terminal:

I hope this will help.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文