Check out CORECLR's source code on GitHub first, run the./build.sh command to compile, and compile the results in the coreclr/bin/product/linux.x64.debug/folder.
Then check out the source code of the Dotnet CLI, run the./build.sh command to compile, and compile the results in the cli/scripts/dotnet-cli-build/bin/folder.
Then copy the compiled result file of CORECLR into the compiled results folder of the dotnet CLI:
cp/git/coreclr/bin/product/linux.x64.debug/*.
Then run the assembly of the. NET core application with your own compiled Corehost command:
#/git/cli/scripts/dotnet-cli-build/bin/corehost AboutUs.dll
AboutUs.dll is an assembly that was previously compiled with the dotnet build command. In addition to AboutUs.dll, in the same folder, also need a aboutus.deps file, if not, will be reported Could not resolve CORECLR path error.. deps file in the application Bin/debug/netsta The ndardapp1.3/ubuntu.14.04-x64/folder.
Now let's look at the results of the operation:
DBUG:MICROSOFT.ASPNETCORE.HOSTING.INTERNAL.WEBHOST[3] Hosting startingdbug: MICROSOFT.ASPNETCORE.HOSTING.INTERNAL.WEBHOST[4] Hosting startedhosting environment:productionapplication Base path:/git/aboutus/bin/debug/netstandardapp1.3now listening on:http://*:8001application started. Press CTRL + C to shut down.
Run successfully!
Run the. NET core application on Linux with your own compiled coreclr and Donet CLI