Re: .NET 4.8 DataGridView causes exception


Andy B.
 

Try using .net 5 preview. It might be/get fixed there first.

 

 

Sent from Mail for Windows 10

 

From: Leonard de Ruijter
Sent: Tuesday, September 1, 2020 1:37 AM
To: nvda-devel@groups.io
Subject: Re: [nvda-devel] .NET 4.8 DataGridView causes exception

 

Hey Karl-Otto,

 

 

This is interesting stuff, thanks for providing it. The fact that it

runs fine on .NET Core makes it unlikely that Microsoft will fix this in

.NET Framework 4.8.

 

Are you known to the Program-L mailing list, program-l@...? It

might be interesting to share your findings there, as there is at least

one person from Microsoft who reads the list and might be able to

consult the right team about this issue.

 

 

Regards,

 

Leonard

 

On 31/08/2020 23:33, Karl-Otto Rosenqvist wrote:

> Hi!

> No, not that project. You cannot just change from .NET Framework to

> .NET Core so I created a new solution with one .NET Core WinForms

> application and one .NET Framework WinForms application.

> They just include one form with a DataGridView that is bound to an

> array at startup. The array contains 3 items with an int, a string and

> a date time property.

> The .NET Core (version 3.1) application starts just fine and displays

> the grid with the three items.

> The .NET Framework (version 4.8) throws an exception of the type I

> mentioned before. If I stop NVDA and run the application again it

> displays correctly. I can then start NVDA and move around in the grid

> just as one could expect.

> I changed to .NET Framework 4.7.2 and the application starts just

> fine, no exception.

> Conclution

> There's a bug in .NET Framework 4.8 regarding the COM visibility that

> causes an exception to be thrown. If started without debugger the

> application runs as expected.

> The problem seems to just appear during debugging so the impact on

> common users who just use an application is minor to none.

> I've attached the solution with the two projects in a zip file if

> anyone would like to test, out of curiosity.

> Kind regards

> Karl-Otto

> Karl-Otto Rosenqvist

> MAWINGU

> Orgnr: 750804-3937

> 0701- 75 98 56

> karl-otto@...

> https://mawingu.se

> Den 2020-08-30 kl. 08:20, skrev Leonard de Ruijter:

>> Hello Karl-Otto,

>> 

>> I wonder, are you by any chance able to update  the project to .net

>> core? It supports win forms as of version 3.

>> 

>> Regards,

>> Leonard

>> 

>>> Op 29 aug. 2020 om 22:58 heeft Karl-Otto Rosenqvist

>>> <Karl-otto@...> het volgende geschreven:

>>> 

>>> Hi!

>>> I just changed the .NET Framework version to 4.8 on a WinForms

>>> application I've created and when I ran it I got the following

>>> exception:

>>> 

>>> Managed Debugging Assistant 'NonComVisibleBaseClass'

>>>   Message=Managed Debugging Assistant 'NonComVisibleBaseClass' :

>>> 'Ett QueryInterface-anrop utfördes med en begäran om

>>> klassgränssnittet för den COM-synliga hanterade klassen

>>> DataGridViewTextBoxCellAccessibleObject. QueryInterface-anropet

>>> kommer dock att misslyckas eftersom den här klassen härleds från

>>> klassen DataGridViewCellAccessibleObject som inte är synlig för COM.

>>> Detta förhindrar att basklasser som inte är synliga för COM

>>> begränsas av versioneringsreglerna för COM.'

>>> 

>>> Ok, it's in swedish but the main problem here seems to be that the

>>> class that the DataGridViewTextBoxCellAccessibleObject derives from

>>> isn't visible for COM and therefore the query interface call will fail.

>>> 

>>> Visual Studio breaks for this exception and even if I press F5 to

>>> keep running the exception is thrown again. If I quit NVDA and then

>>> press F5 the application starts and shows the DataGridView just

>>> fine. I then start NVDA and it seems to work as expected. There's

>>> some new information spoken as "Not sorted" that wasn't there when

>>> it was using an older .NET Framework.

>>> 

>>> I'm running Version: alpha-20775,9a4074bc.

>>> 

>>> Are there anything I can do to further investigate this or should I

>>> just file it as a bug? The problem seems to be related to the .NET

>>> FFramework 4.8 rather than NVDA.

>>> 

>>> 

>>> Kind regards

>>> 

>>> Karl-Otto

>>> --

>>> Karl-Otto Rosenqvist

>>> MAWINGU

>>> Orgnr: 750804-3937

>>> 0701- 75 98 56

>>> karl-otto@...

>>> https://mawingu.se

>>> 

>>> 

>>> 

>> 

>> 

>> 

>

 

 

 

Join nvda-devel@groups.io to automatically receive all group messages.