question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Maui and Grpc cannot work together on MacOS?

See original GitHub issue

Description

Hi, using asp and maui in a single project results in “unsupported” runtime error message.

Questions:

  1. why I get this error? Isn’t grpc supposed to be independent from maui? Grpc itself is supported under Windows, Linux and MacOS.
  2. how to fix it?

I have created similar issue on Community Hub long time ago, no answer till now: https://techcommunity.microsoft.com/t5/app-development/maui-and-grpc-cannot-work-together-on-macos/m-p/3046251

Steps to Reproduce

  1. create a standard maui project (from template).
  2. remove iOS and Android from TargetFrameworks. Only windows and MacCatalyst shall stay (I want to build a cross platform desktop app). <TargetFrameworks>net6.0-maccatalyst</TargetFrameworks> <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows')) and '$(MSBuildRuntimeType)' == 'Full'">$(TargetFrameworks);net6.0-windows10.0.19041</TargetFrameworks>
  3. add grpc nuget reference to the project <PackageReference Include="Grpc.AspNetCore" Version="2.41.0" />
  4. build the project. Following error will be displayed: 1>C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(427,5): error NETSDK1082: There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier ‘maccatalyst-x64’.

Version with bug

Release Candidate 1 (current)

Last version that worked well

Unknown/Other

Affected platforms

macOS

Affected platform versions

MacCatalyst

Did you find any workaround?

no

Relevant log output

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kucintcommented, May 19, 2022

@Falco20019 I have built a test application from scratch, that simulates my problem. I have to admit that the problem is gone (at least partially).

  • MAUI app referencing grpc client in a second library -> builds and works as expected.
  • MAUI app directly referencing grpc in the same project -> causes some build problems that I do not understand.

Anyway, I have a “work around” that functions. Now I have to find why my production app fails and where the undesired reference comes from.

Thanks for your very appreciated help! Best.

1reaction
Eiloncommented, May 18, 2022

@Falco20019 the runtime pack that is chosen depends on what runtime the code ends up running on. I do think that net6.0-maccatalyst is different from net6.0-macos, so if something is compatible with ‘macos’ then it won’t automatically run on ‘maccatalyst’.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Maui and Grpc cannot work together on MacOS?
Maui and Grpc cannot work together on MacOS? Hi,. using asp and maui in a single project results in "unsupported" runtime error message....
Read more >
Tutorial: Create a gRPC client and server in ASP.NET Core
This tutorial shows how to create a gRPC Service and gRPC client on ASP. ... macOS doesn't support ASP. ... NET Core gRPC...
Read more >
how i can Drop Files Into maui app from desktop?
The Open Maui issue for this: github.com/dotnet/maui/issues/6080. There is no workaround listed. Therefore, this cannot be done at this time ...
Read more >
Microsoft doesn't care about publishing MAUI macOS apps ...
I built an open source MAUI Blazor app and I made it work on Web browser, Windows, Linux, Android, iOS and macOS: ...
Read more >
Taking .NET MAUI for a spin - Jon Skeet's coding blog
I've been keeping an eye on MAUI - the .NET Multi-platform App UI - for a while, but I've only recently actually given...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found