-
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
Breaking change - GetEnvironmentVariable / GetEnvironmentVariables treatment of empty string variables #103259
Comments
Possibly relates to #50554 |
I guess this "could" be due to the debian base image changing between However I'd have thought an empty string environment variable is an empty string environment variable Before invoking the .NET process we're logging printf %s "$My__Variable__name" | od -vtc -to1 and it outputs
|
It does not repro for me. Here is transcript of what I have done to reproduce it:
|
Could you please share exact repro steps? |
This issue has been marked |
@jkotas thanks very much for your time already spent looking into this. While I can reproduce the issue on my CI server (JetBrains TeamCity), I'm unable to reproduce it locally/with a docker image and I've given up in my attempts to do so. Apologies for not doing the leg-work initially 💚& thus taking your time. Have ended up amending the shell script to avoid creating empty variables. |
What is the distro that this CI server runs on? It is possible that there may be a bug that repros on some Linux distros only. |
The build step is running within the dotnet SDK docker image ( The build agents are probably running on a variety of Linux distros. If you think the underlying Linux distro could be relevant, I can look into it. |
Description
I've noticed that the treatment of empty string environment variables appears to have changed between .NET7 and .NET8 on Linux
My__Variable__name
was set to an empty string in the shell and exportedEnvironment.GetEnvironmentVariable("My__Variable__name")
was returningnull
Environment.GetEnvironmentVariable("My__Variable__name")
is returning an empty stringI couldn't see this listed under the breaking changes section.
Reproduction Steps
Expected behavior
Perhaps the behaviour change is deliberate, but it should probably be called out
Actual behavior
?
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: