dotnet / runtimelab

This repo is for experimentation and exploring new ideas that may or may not make it into the main dotnet/runtime repo.
MIT License
1.4k stars 197 forks source link

Not work, no native dll generated #2400

Closed neoedmund closed 1 year ago

neoedmund commented 1 year ago

I followed the steps in https://github.com/dotnet/runtimelab/tree/feature/NativeAOT/samples/NativeLibrary

after dotnet publish /p:NativeLib=Shared /p:SelfContained=true -r win-x64 -c release

the only dll is generated, but seems no exports in it. and of course cannot be used by LoadLibrary.c

MSBuild のバージョン 17.7.1+971bf70db (.NET)
  復元対象のプロジェクトを決定しています...
  C:\opt\oss\github\dotnet\runtimelab\samples\NativeLibrary\NativeLibrary.csproj を復元しました (228 ms)。
  NativeLibrary -> C:\opt\oss\github\dotnet\runtimelab\samples\NativeLibrary\bin\release\net6.0\win-x64\NativeLibrary.dll
  NativeLibrary -> C:\opt\oss\github\dotnet\runtimelab\samples\NativeLibrary\bin\release\net6.0\win-x64\publish\
dumpbin /EXPORTS  C:\opt\oss\github\dotnet\runtimelab\samples\NativeLibrary\bin\release\net6.0\win-x64\NativeLibrary.dll
Microsoft (R) COFF/PE Dumper Version 14.37.32822.0
Copyright (C) Microsoft Corporation.  All rights reserved.

Dump of file C:\opt\oss\github\dotnet\runtimelab\samples\NativeLibrary\bin\release\net6.0\win-x64\NativeLibrary.dll

File Type: DLL

  Summary

        2000 .rsrc
        2000 .text

Anything I missed?

jkotas commented 1 year ago

feature/NativeAOT project is no longer maintained in this repo. It was integrated into shipping .NET.

Please follow the instructions and sample at https://learn.microsoft.com/dotnet/core/deploying/native-aot/?tabs=net7%2Cwindows#build-native-libraries

jkotas commented 1 year ago

https://github.com/dotnet/runtime is the right place to open issues against native AOT support.