Skip to content

Latest commit

 

History

History
131 lines (84 loc) · 4.81 KB

getting-started.md

File metadata and controls

131 lines (84 loc) · 4.81 KB

Getting Started

Prerequisites

All commands below are run under a Visual Studio Developer Prompt.

Code

Contribution to this repository is via the fork model. Contributors push changes to their own "forked" version of project-system, and then submit a pull request into it requesting those changes be merged.

To get started:

  1. Fork the repo by clicking Fork in the top right corner:

image

  1. From a Visual Studio Developer Prompt, run (replacing [user-name] with your GitHub user name):
\> git clone https://github.com/[user-name]/project-system
\> cd project-system
\project-system> git remote add upstream https://github.com/dotnet/project-system
\project-system> git remote set-url --push upstream no_push

The last command prevents an accidental push to this repository without going through a pull request.

After running above, git remote -v should show something similar to the following:

\project-system> git remote -v 

origin  https://github.com/davkean/project-system (fetch)
origin  https://github.com/davkean/project-system (push)
upstream        https://github.com/dotnet/project-system (fetch)
upstream        no_push (push)

Build

Command-line

From within a Visual Studio Developer Prompt, from the repo root, run:

project-system> build.cmd

This builds, runs tests and deploys to an experimental instance of Visual Studio.

Visual Studio

From within Visual Studio 2022, open ProjectSystem.sln.

Inside Visual Studio, you can build, run tests and deploy.

Debugging/Deploying

By default when you build inside Visual Studio or the command-line, the project system and other binaries gets deployed to the Exp experimental instance of Visual Studio. They will automatically override any binaries that come with Visual Studio when you launch that instance.

First of all, setup your debugging environment.

Command-line

From the command-line, after you've run build.cmd you can launch a Visual Studio instance with your recently built bits with:

project-system> launch.cmd

Visual Studio

To start debugging:

  1. Open ProjectSystem.sln
  2. Press F5

If this is your first launch of the project system, or ProjectSystem experimental instance, press CTRL+F5 to pre-prime and avoid a long start up time.

For tips, see Debugging Tips

Deploying to a different hive

When testing inconjunction with other repositories, it's handy to be able to deploy to the same hive so that you can test them together.

Both Visual Studio and command-line respect the ROOTSUFFIX environment variable:

project-system> set ROOTSUFFIX=RoslynDev

project-system> build.cmd
project-system> launch.cmd
project-system> set ROOTSUFFIX=RoslynDev

project-system> devenv ProjectSystem.sln

Alternatively, both build.cmd and launch.cmd provide a /rootsuffix switch:

project-system> build.cmd /rootsuffix RoslynDev
project-system> launch.cmd /rootsuffix RoslynDev

Testing

Project System

While the long term goal is to have all C#, F# and Visual Basic projects use this project system, currently only .NET Core, .NET Standard and Shared Projects do. If you want to test other project types, you can manually create a project to test this:

  1. File -> New -> Project -> C# -> Templates -> Visual C# -> Windows -> Console App (.NET Framework)
  2. Right-click on the project and choose Open in File Explorer
  3. File -> Close Solution
  4. In File Explorer, rename project from [project].csproj -> [project].msbuildproj
  5. File -> Open -> Project/Solution and browse to the project you just renamed and choose Open

AppDesigner, Settings, Resource Editors and Property Pages

Both the new project system and the existing project system use the features built from this repository.

Code Coverage

Visual Studio

You can collect code coverage within Visual Studio, to do so, do the following:

  1. Test -> Test Settings -> Select Test Settings File
  2. In Open Settings Files, browse to and select src\CodeCoverage.runsettings. This will exclude files from the coverage run that are not part of the product.
  3. Choose Test -> Analyze Code Coverage -> All Tests