winforms icon indicating copy to clipboard operation
winforms copied to clipboard

[main] Update dependencies from dotnet/runtime

Open dotnet-maestro[bot] opened this issue 3 years ago • 3 comments

This pull request updates the following dependencies

From https://github.com/dotnet/runtime

  • Subscription: d9f5b309-084f-43b5-02de-08d8b80548e4
  • Build: 20220813.9
  • Date Produced: August 14, 2022 8:05:35 AM UTC
  • Commit: 7d986fa00cfc93e656e5bc548f244df82c401b59
  • Branch: refs/heads/main
Microsoft Reviewers: Open in CodeFlow

dotnet-maestro[bot] avatar Aug 11 '22 12:08 dotnet-maestro[bot]

It is building on the CI as well, but looks like a VB related test Microsoft.VisualBasic.Logging.Tests.LogTests.Write is failing:

Error message
System.NullReferenceException : Object reference not set to an instance of an object.


Stack trace
   at Microsoft.VisualBasic.Logging.Tests.LogTests.Write() in /_/src/Microsoft.VisualBasic/tests/UnitTests/Microsoft/VisualBasic/Logging/LogTests.cs:line 24
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)

RussKie avatar Aug 11 '22 23:08 RussKie

@steveharter , it seems that winforms test failure is related to https://github.com/dotnet/runtime/pull/73087 - if TraceSource is initialized from the config file, it does not initialize the default file listener, and test expects the default listener to be initialized. I suspect winforms should come up with a different way to detect initialization from a config fie, could you please suggest one?

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

@steveharter, @Tanya-Solyanik: To be more precise, it is something in the Application Framework for/in Visual Basic, that's causing this, because it does an assumption, which I frankly don't understand:

https://source.dot.net/#Microsoft.VisualBasic.Forms/Microsoft/VisualBasic/Logging/Log.vb,170

image

This assumption is 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.

Now, what I don't understand: Why would (previously) GetSupportedAttributes only have been called, when the trace source was configured by a config file?

KlausLoeffelmann avatar Aug 12 '22 07:08 KlausLoeffelmann

/azp run

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

Azure Pipelines successfully started running 2 pipeline(s).

azure-pipelines[bot] avatar Aug 15 '22 20:08 azure-pipelines[bot]