Compiling and debugging coreclr on Windows

Source: Internet
Author: User
Tags dotnet

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.

    1. 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.
    2. Find install and set as Startup Project
    3. 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),
    4. 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.