Popular blog tags

step 1.发布网站 Build/publish Windows

dotnet publish -c  release dotnet publish -c Release -f netcoreapp2.1 --manifest $env:JITBENCH_ASPNET_MANIFEST (powershell) OR dotnet publish -c Release -f netcoreapp2.1 --manifest %JITBENCH_ASPNET_MANIFEST% (cmd)   dotnet publish -c Release  

Step 2: Run the app

cd E:\Nopcommerce\MslyAspNetGrandNode40\src\Nop.Web\bin\Release\netcoreapp2.0\publish dotnet Nop.Web.dll 发布后定位到publish目录使用 dotnet xx.dll 执行应用。

dotnet run -c Release Dotnet run --urls="http://域名:端口号"  如果想设置多个域名,可以使用分号分隔。

  Step 3:change port 5000 to other  

2. 发布控制台程序为exe 文件 net core 2.0程序默认生成的是一个dll,需要通过dotnet命令来执行他。

dotnet ConsoleApp1.dll 生成带exe的命令则是:--runtime <rid>    

 dotnet build --runtime win-x64

copy D:\Temp\ConsoleApp1\ConsoleApp1\bin\Release\netcoreapp2.1\win-x64\publish下所有文件到另外机器 CMD run ConsoleApp1.exe    

The .NET Core SDK CLI Helpers What this helper basically does, it manifests itself onto the existing dotnettoolchain and exposes some handy commands for quickly switching SDK versions from within the command line. For example: > dotnet sdk 1.0.4 Switching .NET Core SDK version to 1.0.4 You can also get a list of all the installed SDKs by running: > dotnet sdk list The installed .NET Core SDKs are: 1.0.3 1.0.4 1.1.0-preview1-005051 2.0.0-preview1-005977 2.0.0-preview2-006497 If you can't remember the exact version of the latest SDK and want to quickly switch to it, simply pass latest as the version: > dotnet sdk latest .NET Core SDK version switched to latest version. 2.0.0-preview2-006497 .