語法:
想要發布單一檔案則需要在 csproj 檔案中增加 PublishSingleFile
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net7.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<PublishSingleFile>true</PublishSingleFile>
</PropertyGroup>
</Project>
感謝,只要在這裡加上<PublishSingleFile>true</PublishSingleFile>就行了
附帶一聊,M$好像已經不再對basic 做更新了,連帶網站都取消basic 的教學範例