-
Notifications
You must be signed in to change notification settings - Fork 10.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.NET 5.0 apps require libc-dev #24153
Comments
Windows, publish exe by 'generate a single file', an error occurred, the path can be obtained through 'AppContext.BaseDirectory' |
Confirming this is an issue when using the recently released .NET 5 RC2 docker images (runtime and aspnet images) with gRPC 1.32. Adding the below to our dockerfiles works around it:
|
This issue is due to breaking change FrameworkDescription's value is .NET instead of .NET Core in .NET 5.0. I have a fix but I've asked for feedback to make sure I'm not missing something. @angwangiot that's a separate issue that I hit too when publishing a single-file executable for .NET 5.0. This is due to another breaking change Assembly-related API behavior changes for single-file publishing format and is coming from use of A fix for that may be to replace the following in Grpc.Core.Internal.NativeExtension.LoadUnmanagedLibrary: var assemblyDirectory = Path.GetDirectoryName(GetAssemblyPath()); with: var assemblyDirectory = AppContext.BaseDirectory; But I'm not sure how that would interact with IncludeNativeLibrariesForSelfExtract:
(from other considerations for single file deployment.) |
Judging from the current.NET Core documentation, there may be a need for different processing depending on the version and release parameters. |
@angwangiot did you resolve this? I am seeing this too on a .net 5.0 project publish as single exe. Everything was fine with .net core 3.1 |
@aaronhudon-ts the first order fix to .net 5.0 single file executables will be coming in the next Grpc.Core release (2.34.0). |
@gitfool thank you Sean - when can we expect to see this appear in Nuget? |
@aaronhudon-ts your guess is as good as mine, but since v1.34.0 was tagged today (NuGet package uses version+1), I'll be hitting refresh on https://www.nuget.org/packages/Grpc.Core every day. 😉 |
FTR #24744 is the PR that fixed that. |
The 2.34.0 nugets are currently being uploaded, so you can increase the frequency of hitting https://www.nuget.org/packages/Grpc.Core now :-) It would be nice if you could confirm that things are working well for you now. |
I snagged it this morning and integrated the new version with our Blazor project. Publishes to single-exe works now! Thank you for getting this fixed so quickly! |
@aaronhudon-ts good to know! Could you please also try your scenario with the IncludeNativeLibrariesForSelfExtract option? |
I did a test with |
Just want to leave a comment for anyone who happens to reach here with the same error. I had the same error while using Firestore 2.3 which implicitly required Grpc.Core, but as soon as i explicitly referenced Grpc.Core ( in my case 2.36.1 ) in my .csproj this worked. |
What version of gRPC and what language are you using?
Grpc v2.24.0 via Pulumi v2.10.0 NuGet packages for .NET
What operating system (Linux, Windows,...) and version?
Ubuntu 20.04
What did you do?
Run
pulumi up
, which uses grpc under the hood.What did you expect to see?
Run without error.
What did you see instead?
Anything else we should know about your project / environment?
I'm using .NET 5.0 RC1. This looks like a regression of #8156.
I can work around the issue by installing
libc-dev
:sudo apt update && sudo apt install -y libc-dev
The text was updated successfully, but these errors were encountered: