.Net Core 2.0 程序 用vs生成后无exe启动项,如果需要生成exe执行文件可以:
1.修改项目的csproj文件内容
原始:
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
修改后:(加入: <RuntimeIdentifier>win10-x64</RuntimeIdentifier>
)
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
</PropertyGroup>
2.操作:
1.打开Windows PowerShell
2.进入项目根目录命令
cd C:\AAA
3.在项目根目录执行命令:
运行
dotnet run -p AAA.csproj
发布
dotnet publish AAA.csproj
操作完成后 在 publish 文件夹下可发现 exe 文件