-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
net6-android: Environment.SetEnvironmentVariable not shared with native library #71153
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
@akoeplinger I assume this should be |
Tagging subscribers to 'arch-android': @steveisok, @akoeplinger Issue DetailsDescriptionI just ported a Android library from On
Reproduction Steps
Expected behaviorThe call should be made using xDS name resolution. Actual behaviorThe call failed with the above given error message and will never return. Any non-xds calls work just fine. I have no way to check the environment on the native library side, but the message indicates that the environment variables are not shared anymore. Regression?No response Known WorkaroundsNo response ConfigurationNo response Other informationNo response
|
Yep but unfortunately this is expected in .NET 6, environment variables aren't propagated to native code (see the discussion in #9529 for some of the problems) You can manually P/Invoke into |
Tagging subscribers to this area: @dotnet/area-system-runtime Issue DetailsDescriptionI just ported a Android library from On
Reproduction Steps
Expected behaviorThe call should be made using xDS name resolution. Actual behaviorThe call failed with the above given error message and will never return. Any non-xds calls work just fine. I have no way to check the environment on the native library side, but the message indicates that the environment variables are not shared anymore. Regression?No response Known WorkaroundsNo response ConfigurationNo response Other informationNo response
|
Thanks for the update. I also came up with invoking it and that indeed solved my issue. |
Description
I just ported a Android library from
MonoAndroid
tonet6-android
. Sadly, the library (Grpc.Core.Xamarin) uses environment variables to pass thexds_bootstrap.json
path over. There is no other way to set it.On
MonoAndroid
, callingEnvironment.SetEnvironmentVariable("GRPC_XDS_BOOTSTRAP", "...")
did work. Onnet6-android
, I get a runtime error from the library:Reproduction Steps
<TargetFramework>net6.0-android</TargetFramework>
Grpc.Core.Xamarin
using the following lines:xds:///
Expected behavior
The call should be made using xDS name resolution.
Actual behavior
The call failed with the above given error message and will never return. Any non-xds calls work just fine. I have no way to check the environment on the native library side, but the message indicates that the environment variables are not shared anymore.
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: