winforms
winforms copied to clipboard
Fix VB App Framework Logging.
The runtime PR https://github.com/dotnet/runtime/pull/73087 broke the Visual Basic Application Framework Logging.
https://source.dot.net/#Microsoft.VisualBasic.Forms/Microsoft/VisualBasic/Logging/Log.vb,170
The original assumption that this would work was, that when GetSupportedAttributes
gets called in a class derived from TraceSource
that then would tell that the trace source was configured from a config file. This is not only what DefaultTraceSource
does, it seems to be the only reason for it existence. Now, as far as I understand it, after the change, GetSupportAttributes
gets called unconditionally, so HasBeenConfigured
in the VB AppFramework's DefaultTraceSource
returns always true
, and so a FileLogTraceListener gets never added, since the Log class assumes, the trace source was configured by a config file. And that's why there will never be a value other than nothing
for the DefaultFileLogWriter
property.
Microsoft Reviewers: Open in CodeFlow
I don't quite understand the use cases, developer and user experiences. It would be great if you could provide more details explaining those. E.g., this is how a .NET Framework app worked, now ported to .NET 7 it'd work like this. Would a developer or use need to opt-in or opt-out? Thank you
I pretty much explained the breaking change in the runtime which led to this. I added a few lines of explanation in the introduction, what we did. This needs to go in quick, to unblock us.
I would prefer returning a false unconditionally because: 1 quirks are public APIs and it will be difficult to remove them when we have the fix 2. if an application enables logging in the config file, it has also to define a quirk in json file, this is inconvenient 3. we had not exhausted possibilities of a correct fix,
Squash merge please. Or enable auto-merge (that is squash default)
@KlausLoeffelmann is this a breaking change that we need to document?
@RussKie yeah, probably. It would be a minute number of customers impacted but it's good to document it of course.
app config was not enabled in the previous versions, so this is a regression from .NET framework but not from the previous release of Core