Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish Mode Doesn't work in AOT Enabled Project #42

Open
CaiB opened this issue Apr 6, 2023 · 0 comments
Open

Publish Mode Doesn't work in AOT Enabled Project #42

CaiB opened this issue Apr 6, 2023 · 0 comments

Comments

@CaiB
Copy link

CaiB commented Apr 6, 2023

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant