winforms icon indicating copy to clipboard operation
winforms copied to clipboard

Fix VB App Framework Logging.

Open KlausLoeffelmann opened this issue 2 years ago • 1 comments

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

image

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

KlausLoeffelmann avatar Aug 14 '22 23:08 KlausLoeffelmann

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

RussKie avatar Aug 15 '22 03:08 RussKie

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.

KlausLoeffelmann avatar Aug 15 '22 16:08 KlausLoeffelmann

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,

Tanya-Solyanik avatar Aug 15 '22 17:08 Tanya-Solyanik

Squash merge please. Or enable auto-merge (that is squash default)

dreddy-work avatar Aug 15 '22 20:08 dreddy-work

@KlausLoeffelmann is this a breaking change that we need to document?

RussKie avatar Aug 16 '22 03:08 RussKie

@RussKie yeah, probably. It would be a minute number of customers impacted but it's good to document it of course.

merriemcgaw avatar Aug 16 '22 17:08 merriemcgaw

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

Tanya-Solyanik avatar Aug 18 '22 00:08 Tanya-Solyanik