-
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
ConfigurationManager is unusable when called from unmanaged code #25027
Comments
I also experimented with using mapped config, e.g.: var map = new ExeConfigurationFileMap { ExeConfigFilename = file };
config = ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None); called via this: var config_proxy = new ConfigurationProxy("my.dll.config");
config_proxy.InjectToConfigurationManager(); but with the same exception. |
@joshfree Is this the same issue as #21246? |
@Cronan I'm not sure what the expectation is when hosting CoreCLR as to what Were you trying to hit other statics on If you can't even use the returned |
When hosting CoreCLR, https://docs.microsoft.com/en-us/dotnet/api/system.reflection.assembly.getentryassembly?view=netcore-2.0#remarks talks about this. |
@jkotas @JeremyKuhne I think In my code I'm just calling |
We should consider a fix here, or at least don't throw in the case we cannot locate a config file when run from a host. |
Looking. I'll let you know what I find out. |
On Windows, attempt to find the native host to maintain behavior from netfx. Fix dotnet#25027
OS: RH Linux
Framework: .Net Core 2.0
I have a .dll compiled on windows in .net 4.5.2 and written in C#, called from Linux.
I use the code below to inject an app.config file into the system, like so:
However, when run in Linux, I get the following exception:
I've looked at the source here, and can see where the throw is, but can't figure out how to get it working ...
The text was updated successfully, but these errors were encountered: