Search code examples
c#asp.net-coreservicestackmaui.net-7.0

There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier caused by ServiceStack


When adding ServiceStack to a .NET 7 or .NET 8 (preview) MAUI project, the following errors are reported:

There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'maccatalyst-x64'.
There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'iossimulator-x64'.
There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'android-arm64'.

It seems as if this is happening due to ServiceStack referencing Microsoft.AspNetCore.App. I have attempted to explicitly add this package through nuget package, but it is marked as deprecated.

enter image description here

Unfortunately I need to use ServiceStack (for now) because I intend to upgrade an old Xamarin.Forms project to a modern version of .NET, but the fact that even .NET 7 isn't supported is a little concerning.

Does anyone have a workaround? Has anyone used ServiceStack in a .NET 7+ MAUI project?

As a note, I tried to report this issue on ServiceStack's GitHub page, but they do not have an Issues tab.

enter image description here


Solution

  • ServiceStack only has a Framework Reference to Microsoft.AspNetCore.App it doesn't have any package dependencies on it.

    <FrameworkReference Include="Microsoft.AspNetCore.App" />
    

    But it's unlikely you want to reference the ServiceStack ASP .NET Core Server package in a Client Application so I'd recommend only referencing ServiceStack.Client library instead.