Generate Coreclr-windows Articles
The only purpose of this article is to let you run Hello World
Operating Environment
Window 7+
Visual Studio 2015
Make sure that the C + + tool is installed and is not installed by default, so to choose a custom mode, VS 2015 Lite is not supported.
CMake
Download CMake for Windows and add the CMake directory to the system variable for path.
Python
Download python for Windows and install and add the Python directory address to the path system variable.
Powershell
The PowerShell version must be greater than or equal to 3.0, because I use WIN10, which defaults to 4.0, so there is no special upgrade.
Git
Create a new directory with the name Git and, of course, name it anywhere you like. Then execute the following command in bash to clone the repo.
C:\git>git clone https://github.com/dotnet/coreclrC:\git>git clone https://github.com/dotnet/corefx
Demo Directory
Create a new directory, and then create a new 2 folder, one named runtime, and one named packages.
Nuget
Download the NuGet client and place it where you feel fit.
Build
Enter the directory you just cloned, then execute the build clean command, the system will first install the CoreCLR CLI, this is a long process, it is estimated that the entire process is 30-40 minutes to complete, so patience.
For Corefx, it's enough just to execute the build.
Copy DLL
A picture is enough, coreclr need to copy the above file, and Corefx, only need to copy the required, for you this CS file needs. The files are looked up from under the Bin/product directory.
Generate EXE
Using the VS2015 command line tool, execute the following command, of course, the path or something yourself.
Csc/nostdlib/noconfig/r:runtime\mscorlib.dll/out:runtime\helloworld.exe HelloWorld.cs
Debug
The big announcement is done? No, not debug what to do.
- Find CoreCLR.sln This project (of course, the premise is compiled, or directly from git download not this thing), My Computer directory is: D:\coreclr2\coreclr\bin\obj\Windows_NT.x64.Debug.
- Find install and set as Startup Project
- Right-click Install Project, properties, debug, set command to: $ (solutiondir). \.. \product\windows_nt.$ (Platform). $ (Configuration) \corerun.exe, command parameters: HelloWorld.exe, working directory: $ (solutiondir). \.. \product\windows_nt.$ (Platform). $ (Configuration),
- Press F11, ignore all obstacles!
Summary of issues
Workaround, but this approach is not the best because it slows down because the PDB is downloaded remotely.
But unfortunately, my coreclr started to fail. @dudu, why did you fail?
Compiling and debugging coreclr on Windows