-
Notifications
You must be signed in to change notification settings - Fork 58
AspNetCoreModule – setting environment variables in web.config causes double entries with the same key (instead of overwriting existing ones) #235
Comments
Which one do you see in effect inside the process? The one from web.config should mask the system one, right? |
Yes, that is what I would expect, but in my case the system wide setting wins. And btw. when I use my own bat file Process Explorer shows only 1 entry (so in that case it is really overwritten). And another question: I guess all this is done by the aspnetcore module. Is that also opensource? I would look into that... |
@pan-wang Any updates on this? |
@muratg We will fix this in 1.1.0 An environment variable defined in |
But why isn’t this part open source? Or I just did not find it? |
@gregkalapos ANCM will be open source soon. |
as scanning the variables are quite expensive, I changed the order of importing the environment variables, i.e., import user defined one first and then system ones. This will allow user to overwrite the system ones. The fix was checked in. It will be available at next release. |
@pan-wang @shirhatti is this good to close? |
Yes. This was fixed in v1.0.1969 |
Environment
Windows 10, IIS with AspNetCoreModule hosting an Asp.NET Core application on top of full framework.
Steps to reproduce
Let’s say there are some existing environment variables already set on the system. In our case these were COR_ENABLE_PROFILING and COR_PROFILER. See screenshot.
In web.config we wanted to overwrite these settings like this:
I looked into the environment variables for the process with Process Explorer and as you see both values are added to the process.
Expected behavior
The environment variables set in the web.config should overwrite the existing ones.
Current workaround
I created a runWebapplication.bat file, with the following content and in the web.config I replaced processPath=".\WebApplication4.exe" by processPath=".\ runWebapplication.bat".
The text was updated successfully, but these errors were encountered: