Publish Mode Doesn't work in AOT Enabled Project
- Dominant language
- C#
- Stars
- 707
- Forks
- 45
- PR merge metrics
- No merged PRs in 30d
Description
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:
```xml
false
```
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!
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.