You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a VB.NET assembly that contains the following field declaration:
PrivateWithEventsMy_TimerAsTimer
The VB compiler emits the field as a virtual property to make sure that all events are properly registered/unregistered when the value of the field (re)assigned. Unfortunately this cannot be represented in C# and I am not sure why this is even considered valid in metadata. The best we could do is not emitting the virtual modifier, but that would not help you much, because there will be a lot of other compiler errors anyway.
siegfriedpammer
changed the title
Fails to decompile System.Windows.Forms code (like Timer)
Issue when decompiling private VB.NET WithEvents fields
Dec 12, 2023
Input code
Erroneous output
And obviously fails to compile with
Error CS0621 '...': virtual or abstract members cannot be private
Note: I opened the assembly and used the "Save code". But its identical to what ILSpy shows me so decompilation is incorrect.
Details
The text was updated successfully, but these errors were encountered: