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)