Closed colejohnson66 closed 2 years ago
JetBrains dotPeek refuses to decompile the constructor:
public MainWindowViewModel()
{
// ISSUE: unable to decompile the method.
}
@colejohnson66, does peverify.exe report any errors for the assembly that might indicate the source of the issue? Thanks.
@cston Running peverify produces this output:
C:\Users\Cole\Desktop\iDecryptIt\iDecryptIt\bin\Debug\net6.0>peverify iDecryptIt.dll
Microsoft (R) .NET Framework PE Verifier. Version 4.0.30319.0
Copyright (c) Microsoft Corporation. All rights reserved.
[MD]: Error: MethodImpl's Decl (token=0x0a0000e6) and Body (token=0x06000091) method signatures do not match. [token:0x19000003]
1 Error(s) Verifying C:\Users\Cole\Desktop\iDecryptIt\iDecryptIt\bin\Debug\net6.0\iDecryptIt.dll
If needed, I can zip up some files (or the entire output directory) and upload it somewhere.
@colejohnson66
I took a quick look at your repo and noticed that you're using Fody as a part of your build. That is an IL weaving tool that, if it has bugs, can lead to invalid IL and the exceptions you posted here. Looking at the ctor in question nothing stands out as a potential issue to me, the constructor is very straight forward. It leads me to suspect this is actually an issue in the Fody package.
Can you try removing the ReactiveUI.Fody package and see if the constructor continues to generate invalid IL?
Yes. Removing ReactiveUI.Fody
did fix the issue. That doesn't explain why this wasn't an issue previously. I have not updated the NuGet package at all; I've been using ReactiveUI.Fody
17.1.50 since the start of the project and haven't had issues...
This is weird. If I checkout a commit I know was working, it still crashes? Even if I build it using the 6.0.100 SDK. I've tried clearing my NuGet cache and deleting the bin
and obj
directories...
Closing as this does not appear to be a Roslyn issue but instead an issue with ReactiveUI.Fody
. I suggest filing an issue on their repository to track down this particular problem.
Unfortunately I don't have a lot of insight into why this particular error would start showing up recently. Generally I expect an issue like this to happen when you update compilers and they produce a subtly different IL pattern that Fody wasn't expecting or there is an update to Fody, direct or indirect, that brings in a new version that has a bug.
Ah. I've figured it out. You're correct; this is an issue with ReactiveUI.Fody
that only occurs with Nullable<T>
objects: https://github.com/reactiveui/ReactiveUI/issues/2688
Specifically, setting this line:
[Reactive] public DeviceGroup? VKGroupSelectedItem { get; set; } = null;
This used to not happen, but I recently updated my SDK and now I can't work on my program. In debug mode, the exception results. However, in release mode, it launches, but I'm left with a black window. The documentation for this exception implies it's a bug in the compiler.
I've tried
dotnet clean
, and even deleted thebin
andobj
folders, but it did not fix the issue.Version Used: 17.0 (SDK 6.0.202)
Steps to Reproduce:
Expected Behavior: I can debug my program.
Actual Behavior: I get an exception.
Stack Trace: