4d61726b / VirtualKD-Redux

VirtualKD-Redux - A revival and modernization of VirtualKD
GNU Lesser General Public License v2.1
777 stars 136 forks source link

Fixed System.Windows.Markup.XamlParseException #38

Closed thedinosoar closed 2 years ago

thedinosoar commented 2 years ago

Something goes wrong with the invocation of the constructor on type "VirtualBoxIntegration.MainWindow" with an invalid cast exception.

It looks like the error is caused when declaring _VirtualBox = VirtualBox.Virtualbox() and including the VirtualBox header seems to fix the issues.

Also added an error debugging header for the exception window.

4d61726b commented 2 years ago

I'm not seeing how adding the "using" directive actually fixes anything here. My guess is that while doing this, you also installed a newer version of VirtualBox and that is what fixed your issue.

Can you download and run the latest VirtualBoxIntegration executable (from 2021.3) and report back as to whether you still get an exception?

4d61726b commented 2 years ago

I'm going to reject this PR because I don't think it adds any value or fixes any issues. Adding the "using" directive in this case shouldn't affect anything about the way the code runs.

When you built VirtualKD-Redux on the same machine that has your VirtualBox installation, it will use the VirtualBox assembly references associated with that install. If you had an older version of VirtualBox installed (i.e. older than 6.1), then things will work and you won't get an error, with or without your proposed code changes.

If you had upgraded VirtualBox to 6.1.x, then this shouldn't be an issue either. This is the recommended solution and the reason why those checks exist in that code that you were looking at.

I haven't heard back from you so I assume it's one of the two scenarios I described above. If not, let me know and we can discuss further.

thedinosoar commented 2 years ago

Tried the 2021.3 release and that worked perfectly.

Thanks!