我正试图在Azure DevOps上使用.NET CLI构建一个.NET应用程序。最初,我试图在AppCenter上这样做,但没有运气。导出-and tweeking之后--为在AzureDevops上导入应用程序中心构建配置--我使用了这个问题。
因此,我在tweeked上更多地使用了.NET CLI,而不是mono。
以下是项目文件的相关部分:
<PropertyGroup>
<TargetFramework>net6.0-ios16.0</TargetFramework>
<OutputType>Exe</OutputType>
<Nullable>enable</Nullable>
<ImplicitUsings>true</ImplicitUsings>
<CodesignKey>iPhone Developer</CodesignKey>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<CodesignProvision>iOS Team Provisioning Profile: com.xamarin.sample.TestApplication</CodesignProvision>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
<CreatePackage>false</CreatePackage>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<CreatePackage>false</CreatePackage>
<CodesignProvision></CodesignProvision>
</PropertyGroup>这是.NET任务配置命令行:
/p:Configuration=Release /p:Platform=iPhone /p:BuildIpa=true /t:Rebuild /p:Codesignkey="iPhone Distribution: ZZZZZZ (ABCDEFGH)" /p:CodesignProvision=XXXXXXX-YYYY-ZZZZ-AAAA-BBBBBBBBB以及由此产生的日志:
/Users/runner/hostedtoolcache/dotnet/dotnet build /Users/runner/work/1/s/TestApplication/TestApplication.csproj -dl:CentralLogger,"/Users/runner/work/_tasks/DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b/2.210.0/dotnet-build-helpers/Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"*ForwardingLogger,"/Users/runner/work/_tasks/DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b/2.210.0/dotnet-build-helpers/Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /p:Configuration=Release /p:Platform=iPhone /p:BuildIpa=true /t:Rebuild /p:Codesignkey=iPhone Distribution: MATROT.TECH (XXXXXXXX) /p:CodesignProvision=d8186d97-7e3c-4745-a454-f69b8adea971
MSBuild version 17.3.2+561848881 for .NET
Determining projects to restore...
All projects are up-to-date for restore.
Detected signing identity:
Provisioning Profile: "NET 6 Xamarin Widget Sample" (d8146d97-7e3b-4782-a734-f69b8aead971)
Bundle Id: com.xamarin.sample.test.net6application
App Id: com.xamarin.sample.test.net6application
##[warning]TestApplication/AppDelegate.cs(61,32): Warning CS8604: Possible null reference argument for parameter 'path' in 'void File.WriteAllText(string path, string? contents)'.
/Users/runner/work/1/s/TestApplication/AppDelegate.cs(61,32): warning CS8604: Possible null reference argument for parameter 'path' in 'void File.WriteAllText(string path, string? contents)'. [/Users/runner/work/1/s/TestApplication/TestApplication.csproj]
##[warning]TestApplication/AppDelegate.cs(68,35): Warning CS8618: Non-nullable property 'Data' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
/Users/runner/work/1/s/TestApplication/AppDelegate.cs(68,35): warning CS8618: Non-nullable property 'Data' must contain a non-null value when exiting constructor. Consider declaring the property as nullable. [/Users/runner/work/1/s/TestApplication/TestApplication.csproj]
##[warning]TestApplication/AppDelegate.cs(73,16): Warning CS8618: Non-nullable property 'Value' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
/Users/runner/work/1/s/TestApplication/AppDelegate.cs(73,16): warning CS8618: Non-nullable property 'Value' must contain a non-null value when exiting constructor. Consider declaring the property as nullable. [/Users/runner/work/1/s/TestApplication/TestApplication.csproj]
##[warning]TestApplication/AppDelegate.cs(74,16): Warning CS8618: Non-nullable property 'Delta' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
/Users/runner/work/1/s/TestApplication/AppDelegate.cs(74,16): warning CS8618: Non-nullable property 'Delta' must contain a non-null value when exiting constructor. Consider declaring the property as nullable. [/Users/runner/work/1/s/TestApplication/TestApplication.csproj]
TestApplication -> /Users/runner/work/1/s/TestApplication/bin/iPhone/Release/net6.0-ios16.0/iossimulator-x64/TestApplication.dll如果您看一看日志的最新行,您会发现构建的结尾是一个模拟器,而不是我所要求的iPhone?
知道吗?
发布于 2022-11-02 09:57:05
我使用命令行上的以下开关解决了这个问题:
/p:Platform=arm64 /p:RuntimeIdentifier=ios-arm64
https://stackoverflow.com/questions/74263766
复制相似问题