- Visual Studio 16.3 Preview 2 or higher
- GitHub account
- Basic Git experience: https://docs.github.com/get-started/quickstart/set-up-git
All commands below are run under a Visual Studio Developer Prompt.
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:
- Fork the repo by clicking Fork in the top right corner:
- 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)
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.
From within Visual Studio 2022, open ProjectSystem.sln.
Inside Visual Studio, you can build, run tests and deploy.
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.
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
To start debugging:
- Open ProjectSystem.sln
- 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
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
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:
- File -> New -> Project -> C# -> Templates -> Visual C# -> Windows -> Console App (.NET Framework)
- Right-click on the project and choose Open in File Explorer
- File -> Close Solution
- In File Explorer, rename project from [project].csproj -> [project].msbuildproj
- File -> Open -> Project/Solution and browse to the project you just renamed and choose Open
Both the new project system and the existing project system use the features built from this repository.
You can collect code coverage within Visual Studio, to do so, do the following:
- Test -> Test Settings -> Select Test Settings File
- 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.
- Choose Test -> Analyze Code Coverage -> All Tests