Disasmo icon indicating copy to clipboard operation
Disasmo copied to clipboard

Publish Mode Doesn't work in AOT Enabled Project

Open CaiB opened this issue 1 year ago • 0 comments

Hello,

Thanks for this awesome extension, this is something I've wanted for a long time.

One issue I've encountered is the following:

  • I have some NuGet packages that my project uses, and when using the default "dotnet build" option, this fails to install them in the target directory, and I get this error:
Unhandled exception. System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
Could not load file or assembly 'Vortice.Win32, Version=1.9.14.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
Could not load file or assembly 'Vortice.Win32, Version=1.9.14.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.Assembly.GetTypes()
   at DisasmoLoader.PrecompileAllMethodsInType(String[] args)
   at DisasmoLoader.Main(String[] args)

Switching to "dotnet publish" mode, I now get this error:

C:\Program Files\dotnet\sdk\7.0.202\Sdks\Microsoft.DotNet.ILCompiler\build\Microsoft.NETCore.Native.Publish.targets(53,5):
error : PublishTrimmed is implied by native compilation and cannot be disabled. [pathtomy.csproj]

Disabling AOT by changing this option to false the ProperyGroup of my csproj:

<PublishAot>false</PublishAot>

Fixes the issue, and now Disasmo works in "dotnet publish" mode, however I then need to re-enable this option for other debugging and tests. Is there any way to get Disasmo working in an AOT project?

Thanks!

CaiB avatar Apr 06 '23 23:04 CaiB