viktorgobbi commented on issue #162: URL: https://github.com/apache/logging-log4net/issues/162#issuecomment-5343090832
@FreeAndNil Yes, we still have this problem. We currently have a workaround in place for this by embedding both versions of the `System.Configuration.ConfigurationManager` assembly into our library and loading them in an `AssemblyResolve` event depending on whether our library is loaded in .NET Framework or .NET core/5+. We use log4net in our internal logging library which targets .netstandard2.0 as we have projects for .NET Framework or .NET core/5+. I have briefly tested using the .netframework log4net assembly in .net core and it seem to work so the best solution for us at this moment might be to completely switch our library back to .net framework (due to the previously mentioned issue with the powerShell.exe.config). I still think that this issue could be relevant for other users as this bug also comes up in .net core too whenever `Assembly.GetEntryAssembly()` returns `null` which happens whenever the core runtime is hosted in a native application (the related bug in `System.Configuration.ConfigurationManager` - https://github.com/dotnet/runtime/issues/25027 - was fixed only with version >= 5.0.0 according to the GitHub issue). I have updated (with the help of copilot) the previously provided solution with a native application that hosts the coreCLR and calls the library and the same error ("Platform not supported") can be observed there with the latest version of log4net and a `.net10.0` targeted library. [log4netConfigErrorNativeSln.zip](https://github.com/user-attachments/files/31225456/log4netConfigErrorNativeSln.zip) Steps to reproduce: 1. Download, extract and build solution (Requires c++ build tools in VS) 2. Run the NativeHost.exe 3. Result: <img width="1599" height="2038" alt="Image" src="https://github.com/user-attachments/assets/21817227-5b95-4e29-b2e8-195ff936238b" /> When the `System.Configuration.ConfigurationManager` package is upgraded (in Lib1.csproj e.g. `<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.2" /> `) to a version >= 5.0.0 the issue disappears: <img width="1850" height="251" alt="Image" src="https://github.com/user-attachments/assets/60bc2ac5-f1df-4e1c-9eeb-f872a5f89aa3" /> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
