Fix SingleFile regression in client configuration#42176
Fix SingleFile regression in client configuration#42176safern merged 3 commits intodotnet:masterfrom am11:feature/singlefile/configurationmanager
Conversation
|
Tagging subscribers to this area: @dotnet/ncl |
|
Tagging subscribers to this area: @agocke |
...ries/System.Configuration.ConfigurationManager/src/System/Configuration/ClientConfigPaths.cs
Outdated
Show resolved
Hide resolved
...ries/System.Configuration.ConfigurationManager/src/System/Configuration/ClientConfigPaths.cs
Outdated
Show resolved
Hide resolved
...ries/System.Configuration.ConfigurationManager/src/System/Configuration/ClientConfigPaths.cs
Outdated
Show resolved
Hide resolved
...ries/System.Configuration.ConfigurationManager/src/System/Configuration/ClientConfigPaths.cs
Outdated
Show resolved
Hide resolved
...ries/System.Configuration.ConfigurationManager/src/System/Configuration/ClientConfigPaths.cs
Outdated
Show resolved
Hide resolved
|
Tagging subscribers to this area: @safern |
...ries/System.Configuration.ConfigurationManager/src/System/Configuration/ClientConfigPaths.cs
Outdated
Show resolved
Hide resolved
...ries/System.Configuration.ConfigurationManager/src/System/Configuration/ClientConfigPaths.cs
Outdated
Show resolved
Hide resolved
...ries/System.Configuration.ConfigurationManager/src/System/Configuration/ClientConfigPaths.cs
Outdated
Show resolved
Hide resolved
...ries/System.Configuration.ConfigurationManager/src/System/Configuration/ClientConfigPaths.cs
Show resolved
Hide resolved
|
ping - if there are no other comments, can this be merged? |
|
I think it might be to late to get it backported to 5.0.0 but I'll ask @ericstj and @danmosemsft |
|
We are close to "would we service for this" bar now. @ericstj ? |
|
I don’t have a good read on bar for single file scenario. This change is not without risk. @agocke @jeffschwMSFT do you support this? |
|
My initial feeling is we should not risk destablizing non-single-file scenario for the single-file scenario unless this is really critical. So here's my question: this change was really made to support ConfigurationManager. How prevalent is that? Is this going to hit a large portion of apps within 5 minutes? Is there any workaround? |
Yes, although risk is not high. We have a good test coverage of client configuration. We just don't have tests for signlefile form factor, it was not the intentional breakage.
I think fair to say; not any less prevalent than [m]any other fixes being backported to 5.0. it seems these single file regressions were not intended by this change: #40974. It happened due to lack of single file test infra and made known when the user reported in #42161. |
Not so. ConfigurationManager is just a .NETFramework compat assembly. We don’t reccomend it’s use for new code. It is not part of the shared framework. Question for anyone consuming this: do you actually have an end to end that works well in single file? @mshobohm can you let us know? |
|
@JeremyKuhne @merriemcgaw do you think this would be important for Windows Forms apps using Single File? I know WinForms has some Settings integration that other components do not. |
For me the bug fix in 6.0 was to late, I went life with 5.0 rc1,publishsinglefile and a simple workaround:Convert App.config to myAppname.Settings.json ConfigurationManager (in my opinion) has 2 disadvantages:
Keep it simple keep it stupid (KISS) would be to give the (relative or Full) Path of the config file not the path of the exe-file |
|
In terms of simplicity I think your workaround approach is better for simple immutable application configuration. Another option might be Microsoft.Extensions.Configuration. System.Configuration is a legacy API that carries the overhead of the desktop scenarios that are no longer interesting or fully supported, eg: strongly-typed configuration classes, layered machine/user/app config, XML, etc.
We have a high-bar for the product right now as we approach GA, and an even higher bar in servicing. We need to justify the importance of fixes because we have to weigh the benefit of the fix over the risk of breaking other customers. It's especially important when we look at a fix in a legacy component like this, where a lot of people are using specifically because they don't/can't touch the old code that is using it. Taking it in 6.0 gives us a longer bake time to discover potential issues with the fix before it released. |
Yes, but I'm not clear on exactly how important. Users are definitely still using |
This PR attempts to fix a 3.1 to 5.0 observable regression in
ConfigurationManagerAPIs.Starting with 5.0
System.Reflection.Assembly.GetEntryAssembly().ManifestModule.Namein app published withPublishSingleFile=Truereturns<Unknown>string.With 3.1 it returns a pseudoname:
MyApp.dllwith the singlefile executable with nameMyApp(without.dll).This change adjusts
ClientConfigPathsimplementation such that it stays compatible with 3.1 behavior.Fixes #42161
cc @vitek-karas, @jkotas, I tested locally that it fixes the reported 3.1 -> 5.0 regression in #42161; but I am not sure if there is enough infra to exercise SingleFile publish integration test.