# nuget套件打包時,包含C語言的dll的方法 這次遇到的問題是,要如何讓使用者安裝nuget套件後,會在程式輸出目錄看到dll,看到很多相關的[討論](https://github.com/NuGet/Home/issues/6645) 平台是.NET 8 修改.csproject中的 ```xml <ItemGroup> <None Update="A.dll"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> </ItemGroup> ``` 改為這樣 ```xml <ItemGroup> <Content Include="A.dll"> <Pack>true</Pack> <PackagePath>lib\$(TargetFramework)</PackagePath> </Content> </ItemGroup> ``` 補充一下,這個方法依照[@zivkan](https://github.com/zivkan)的[說法](https://github.com/NuGet/Home/issues/6645#issuecomment-1952038297)的說法,再MAC跟Linux上面行不通,但可以參閱[這份文件](https://learn.microsoft.com/zh-tw/nuget/create-packages/native-files-in-net-packages)完成,但因為我還沒有這個需求,所以還沒深入研究
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up