无法在 Azure DevOps 中使用 Visual Studio 17.8.3 包发布面向 iOS 的 ASP.NET 7 或 8 Maui 应用程序

问题描述 投票:0回答:1

我的应用程序过去使用 Azure DevOps 发布得很好,当时它是一个面向 iOS 16.1 并具有 15.4 支持框架的 ASP.NET 7 应用程序。我使用的是 Visual Studio Enterprise 2022 17.5.3 包。

我现在正在尝试使用 17.8.3 包发布针对 iOS 17 的应用程序以及 16.1 支持的框架。

构建在发布任务上失败。这是出现错误之前的最后一条消息。

/Users/runner/work/1/s/ViewModels/MainViewModel.cs(108,28): warning CS0108: 'MainViewModel.OnPropertyChanged(string)' hides inherited member 'ObservableObject.OnPropertyChanged(string?)'. Use the new keyword if hiding was intended. [/Users/runner/work/1/s/MyAppName.csproj::TargetFramework=net8.0-ios17.0]

这是错误消息:

##[error]Error: The process '/Users/runner/hostedtoolcache/dotnet/dotnet' failed with exit code 1
##[warning].NET 5 has some compatibility issues with older Nuget versions(<=5.7), so if you are using an older Nuget version(and not dotnet cli) to restore, then the dotnet cli commands (e.g. dotnet build) which rely on such restored packages might fail. To mitigate such error, you can either: (1) - Use dotnet cli to restore, (2) - Use Nuget version 5.8 to restore, (3) - Use global.json using an older sdk version(<=3) to build
Info: Azure Pipelines hosted agents have been updated and now contain .Net 5.x SDK/Runtime along with the older .Net Core version which are currently lts. Unless you have locked down a SDK version for your project(s), 5.x SDK might be picked up which might have breaking behavior as compared to previous versions. You can learn more about the breaking changes here: https://docs.microsoft.com/en-us/dotnet/core/tools/ and https://docs.microsoft.com/en-us/dotnet/core/compatibility/ . To learn about more such changes and troubleshoot, refer here: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#troubleshooting
##[error]Dotnet command failed with non-zero exit code on the following projects : [ '/Users/runner/work/1/s/MyAppName.sln' ]
Finishing: dotnet publish (Debug)

以下是升级说明。 https://github.com/dotnet/maui/wiki/Upgrading-.NET-MAUI-from-.NET-7-to-.NET-8

还有其他人让它工作吗?

azure-devops xamarin.ios azure-pipelines maui
1个回答
0
投票

现在正在工作。我最终停止使用“属性”选项卡对 csproj 进行更改。这是现在的配置。

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-ios17.0|AnyCPU'">
  <MtouchUseLlvm>False</MtouchUseLlvm>
  <UseInterpreter>true</UseInterpreter>
  <MtouchLink>None</MtouchLink>
  <BuildIpa>True</BuildIpa>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0-ios17.0|AnyCPU'">
  <MtouchUseLlvm>False</MtouchUseLlvm>
  <UseInterpreter>true</UseInterpreter>
  <MtouchLink>None</MtouchLink>
  <BuildIpa>True</BuildIpa>
</PropertyGroup>

就我而言,我还多次看到以下错误出现。

错误 CS0246:找不到类型或命名空间名称“Android”(您是否缺少 using 指令或程序集引用?)

为了解决这个问题,我转到了发生错误的文件。然后我注释掉了 Android using 语句。它们从第一天起就存在于文件中,所以我不确定为什么它们突然引起构建/发布问题。

© www.soinside.com 2019 - 2024. All rights reserved.