Roslyn Study Notes (i)

Source: Internet
Author: User
Tags dotnet

This document records the installation and compilation process of the Roslyn development environment, and references the official documentation for the following Roslyn projects

Https://github.com/dotnet/roslyn/blob/master/docs/contributing/Building,%20Debugging,%20and%20Testing%20on%20Windows.md

Development environment:

    • Windows Server R2 virtual machines
    • Install Git
    • Installation VS2015 Upadte 1 Community version
      • VS2015 requires more than IE10 browser
      • Available at Http://download.microsoft.com/download/5/7/A/57A99666-126E-42FA-8E70-862EDBADD215/vs2015.1.com_ Enu.iso download vs2015 ISO version, offline installation
      • Offline installation process, encountered a MS SQL data client or something installation error, skip directly

Download Source code:

    • Create a working directory C:\roslyn
    • Open git Bash in the working directory and execute the command: Git clone https://github.com/dotnet/roslyn.git. When the command is complete, a new Roslyn directory is created with all the source code, and you can see three solution files in the C:\roslyn\roslyn directory:
      • Compilers.sln: Contains only the most basic project related to the compilation process
      • CrossPlatform.sln: Contains related projects that compile and run Roslyn in a Linux environment
      • Roslyn.sln: All items included
    • Switch to the C:\roslyn\roslyn directory in Git bash and execute the command: Git checkout-b test, create and switch to a new test branch to ensure that any future modifications do not affect the master branch.

Compiling and testing:

    • The code you just downloaded cannot be compiled directly in VS2015, and there will be more than 300 compilation errors if compiled directly in VS2015.
    • Open "Developer Command Prompt for VS2015" from the Start menu and switch to the directory where Roslyn is located (C:\roslyn\roslyn)
    • Execute command restore.cmd restore NuGet packages
    • Execute command msbuild/v:m/m Roslyn.sln compile code, compile all the code in VS2015 to compile
    • Execute the command msbuild/v:m/m BuildAndTest.proj perform all unit tests. Except C:\rosyln\roslyn\src\ExpressionEvaluator\CSharp\Test\ExpressionCompiler\. The test case in WinMdTests.cs otherframeworkassembly, all other unit tests can pass. Feel this failed test is related to the environment and has not been tested in Windows 8 or Windows 10 environments for the time being.
    • All test results can be found in the C:\rosyln\roslyn\Binaries\Debug\xUnitResults directory, both in XML format
    • Set the test project as the startup project in VS2015 and execute the project to generate a test report in HTML format (also generated in the C:\rosyln\roslyn\Binaries\Debug\xUnitResults directory)

Roslyn Study Notes (i)

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.