谁能解释一下 NetCoreApp 程序是如何启动的?
这里只有dll。如何运行它?只能通过控制台dotnet dll
?我可以创建一个 exe 来运行吗?(Windows 10)
\StartApp\bin\Debug\netcoreapp1.1\StartApp.dll
\StartApp\bin\Debug\netcoreapp1.1\StartApp.deps.json
\StartApp\bin\Debug\netcoreapp1.1\StartApp.runtimeconfig.json
\StartApp\bin\Debug\netcoreapp1.1\StartApp.runtimeconfig.dev.json
\StartApp\bin\Debug\netcoreapp1.1\StartApp.pdb
.NET Core 1.1中的过程已经足够详细了——如何发布一个独立的应用程序
最小更改集:
将所需的 RuntimeIdentifier 添加到 csproj:
恢复依赖:
使用运行时发布:
二进制文件将收集在一个文件夹
bin\release\netcoreapp1.1\win10-x64
中。同样,对于其他运行时,输入几个RuntimeIdentifiers就可以了,构建时指定你需要的那个:
该方法也适用于其他类型的应用程序,例如 ASP.NET Core。