[英]Compile C# console without dll needed
When I compile my C# Console it comes with an dll, if I remove the dll the application doesn't work, and I need it to work with only an.exe and no.dll files. https://prnt.sc/t1gu4m
瞧,你得到了一個具有所需依賴項的 exe
除了莫里斯樂高樂園的回答。 如果您使用的是 dotnet cli,請運行:
dotnet publish -p:PublishSingleFile=true --no-self-contained # Other arguments.
如果您希望您的可執行文件依賴於 .NET,則僅使用--no-self-contained
標志,即,如果用戶沒有 .NET 的 CoreCLR,它就無法運行。 否則,只需將 PublishSingleFile 設置為 true。 您還可以使用清單/配置文件。 有關更多信息,請參閱此。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.