Closed blackmaple closed 3 months ago
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas See info in area-owners.md if you want to be subscribed.
I'm not able to reproduce it in my local environment:
ordinal hint RVA name
1 0 000F8380 DotNetRuntimeDebugHeader = DotNetRuntimeDebugHeader
2 1 000675B0 Test = NativeAotExport_Test_TestDllExport__Test
3 2 000675E0 Test1 = NativeAotExport_Test_TestDllExport__Test1
While I'm using .NET 9 nightly build though.
@hez2010 Hi, 大佬
Are you suggesting that we use .NET 9 nightly builds instead of Preview 6? We will try that again.
There is a minimal repo; please review: https://github.com/LuohuaRain/dotnet-9-aot-issue/
By the way, everything works fine with .NET 8, but there are issues with .NET 9 when compiling to DLL
.
<OutputType>Library</OutputType>
<StackTraceSupport>false</StackTraceSupport>
@hez2010
I build your repro but still not able to reproduce it.
Can you try building it with command line dotnet publish -c Release -r win-x64 /p:PublishAot=true
instead of using Visual Studio?
@hez2010
SDK: 9.0.100-preview.6.24328.19
The dotnet command still produces the same error.
PS C:\source\repos\ConsoleApp1> dotnet publish -c Release -r win-x64 /p:PublishAot=true
Restore complete (0.6s)
You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
ConsoleApp1 succeeded (2.0s) → ConsoleApp1\bin\Release\net9.0\win-x64\publish\
Build succeeded in 2.9s
The build succeeded, but the output file is 0 kb
After you clean bin
and obj
folders, it will cause Result 2
PS C:\source\repos\ConsoleApp1> dotnet publish -c Release -r win-x64 /p:PublishAot=true
Restore complete (1.5s)
You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
ConsoleApp1 failed with 3 error(s) (5.4s) → ConsoleApp1\bin\Release\net9.0\win-x64\ConsoleApp1.dll
ConsoleApp1.def : error LNK2001: unresolved external symbol Test1
bin\Release\net9.0\win-x64\native\ConsoleApp1.lib : fatal error LNK1120: 1 unresolved externals
C:\Users\Admin\.nuget\packages\microsoft.dotnet.ilcompiler\9.0.0-preview.6.24327.7\build\Microsoft.NETCore.Native.targets(373,5): error MSB3073: The command ""C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.40.33807\bin\Hostx64\x64\link.exe" @"obj\Release\net9.0\win-x64\native\link.rsp"" exited with code 1120.
Build failed with 3 error(s) in 7.1s
Could it be that this issue has been fixed in the .NET 9 preview nightly build?
https://aka.ms/dotnet/9.0.1xx/daily/dotnet-sdk-win-x64.exe https://aka.ms/dotnet/9.0.1xx/daily/dotnet-sdk-win-x86.exe
I tried installing 9.0.100-rc.1.24377.5, but some required dependencies were missing, so I couldn't test it.
I tried installing 9.0.100-rc.1.24377.5, but some required dependencies were missing, so I couldn't test it.
To use the nightly sdk, you need to add an additional package source to your nuget config:
<configuration>
<packageSources>
<add key="dotnet9" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json" />
</packageSources>
</configuration>
This is broken in preview 6, got fixed a month ago in #103884 so that's why it no longer reproes.
Description
In dotNET 9 AOT, when configuring
StackTraceSupport
tofalse
, only one function is exported successfully during AOT compilation. Exporting other functions results inLNK1120
errors. This issue does not occur in dotNET 8 AOT.StackTraceSupport = false
Reproduction Steps
StackTraceSupport
tofalse
in dotNET 9 AOT configuration.LNK1120
errors for functions other than the first one.Expected behavior
Functions should be exported correctly during AOT compilation in dotNET 9, regardless of the
StackTraceSupport
setting.Actual behavior
In dotNET 9 AOT, when configuring
StackTraceSupport
tofalse
, only one function is exported successfully during AOT compilation. Exporting other functions results inLNK1120
errors. This issue does not occur in dotNET 8 AOT.Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response