【发布时间】:2022-12-01 13:24:45
【问题描述】:
I am trying to publish my app on the app store. My project contains of the regular maui project and a middleware.data service that also needs to be build into the archive.
this is my csproj from that middleware.data:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Compile Remove="ITodoService.cs" />
<Compile Remove="Models\TodoItem.cs" />
<Compile Remove="Models\TodoServiceEventArgs.cs" />
<Compile Remove="MVVM\TodoListViewModel.cs" />
<Compile Remove="Services\InMemoryTodoService.cs" />
<Compile Remove="Services\InMemoryUserService.cs" />
<Compile Remove="Services\RemoteTodoService.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Datasync.Client" Version="5.0.12" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
</ItemGroup>
</Project>
As you can see, in the beginning it says the target framework is net6.0.
If I were to add ;net6.0-ios to the target frameworks, i can no longer build the data service.
Now, If I try to archive my ios project over the console:
dotnet publish -f:net6.0-ios -c:Release -r ios-arm64
I get:
SkillbasedMiddleware.Data/obj/project.assets.json' doesn't have a target for 'net6.0-ios'. Ensure that restore has run and that you have included 'net6.0-ios' in the TargetFrameworks for your project.
and
The RuntimeIdentifier platform 'ios-arm64' and the PlatformTarget 'x64' must be compatible
if I try to archive without the runtime specified i also get:
A runtime identifier must be specified in order to publish this project.
I cant really seem to understand how to archive, can you guys help me out here?
【问题讨论】: