EgorBo / Disasmo

VS2022 Add-in. Click on any method or class to see what .NET Core's JIT generates for them (ASM).
MIT License
657 stars 41 forks source link

Issues disassembling in "Run" mode #64

Open kg opened 1 month ago

kg commented 1 month ago

Frequently Disasmo fails to disassemble anything unless Run is checked. That's fine, it's not too hard to check Run.

Unfortunately Run frequently breaks at random in multiple ways:

  1. It will run a random other project in the solution instead of the one containing the method. If that project never terminates, disasmo hangs. For example my solution contains a BDN benchmark suite and then a simple test application that serves as a disassembly harness; disasmo will randomly choose to run the BDN suite and then hang. I have to unload the project and restart VS to fix this once it happens.

  2. Run will randomly fail sometimes with this error:

    A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'E:\Documents\Projects\SimdDictionary\bin\Release\net8.0\Disasmo-v5.9.2\'.
    Failed to run as a self-contained app.
    - The application was run as a self-contained app because 'E:\Documents\Projects\SimdDictionary\bin\Release\net8.0\Disasmo-v5.9.2\SimdDictionary.runtimeconfig.json' was not found.
    - If this should be a framework-dependent app, add the 'E:\Documents\Projects\SimdDictionary\bin\Release\net8.0\Disasmo-v5.9.2\SimdDictionary.runtimeconfig.json' file and specify the appropriate framework.

I have no idea how to work around the second one and I'm not sure why it only happens sometimes.

Thanks for this cool extension!

kg commented 1 month ago

Looking closer, it seems like in 2. it's trying to run a class library instead of the active project that contains the method being disassembled (an exe).

kg commented 1 month ago

Third failure mode if you unload a project and it tries to run that one anyway:

System.NotImplementedException: Not implemented (Exception from HRESULT: 0x80004001 (E_NOTIMPL))
   at EnvDTE.Project.get_FileName()
   at Disasmo.MainViewModel.<RunOperationAsync>d__80.MoveNext()
EgorBo commented 1 month ago

Thanks! Let me take a look, I've seen some of these too

kg commented 1 month ago

It seems like it may be determined by which project you have selected in Solution Explorer, like by clicking on it image