在Linux上用自己编译出来的coreclr与donet cli运行asp.net core程序

先在 github 上签出 coreclr 的源代码,运行 ./build.sh 命令进行编译,编译结果在 coreclr/bin/Product/Linux.x64.Debug/ 文件夹中。

接着签出 dotnet cli 的源代码,运行 ./build.sh 命令进行编译,编译结果在 cli/scripts/dotnet-cli-build/bin/ 文件夹中。

然后将 coreclr 的编译结果文件复制到 dotnet cli 的编译结果文件夹中:

cp /git/coreclr/bin/Product/Linux.x64.Debug/* .

接着用自己编译出来的 corehost 命令运行 .net core 应用程序的程序集:

# /git/cli/scripts/dotnet-cli-build/bin/corehost AboutUs.dll

接下来看一下运行结果:

dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[3]
      Hosting starting
dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[4]
      Hosting started
Hosting environment: Production
Application base path: /git/AboutUs/bin/Debug/netstandardapp1.3
Now listening on: http://*:8001
Application started. Press Ctrl+C to shut down.

猜你喜欢

转载自www.linuxidc.com/Linux/2016-06/132139.htm