Skip to content

The .NET Project System for Visual Studio

License

Notifications You must be signed in to change notification settings

Terminou/project-system

 
 

Repository files navigation

The .NET Project System for Visual Studio

Release Build Compliance Publish Localization
main MainBuild MainCompliance MainPublish MainLocalization
16.11 1611Build
17.0 170Build
17.1 171Build
17.2 172Build
17.3 173Build
17.4 174Build 174Compliance 174Publish 174Localization

This repository contains the .NET Project System for Visual Studio that is written on top of the Common Project System (CPS) framework. In Visual Studio 2017, Visual Studio 2019, and Visual Studio 2022, this project system is used for .NET Core [SDK-style] (C#, F# and Visual Basic) and Shared Projects (C# and Visual Basic) project types. In the long term, this project system will be the basis for all C#, F# and Visual Basic project types. For a list of feature differences between the project systems, see Feature Comparison.

The legacy C# and Visual Basic project systems (csproj.dll and msvbprj.dll) first shipped with Visual Studio .NET in 2002. They have served us well but are:

  • Native and COM-based
  • Single threaded and bound to the UI thread
  • Hard to extend outside of aggregation via the use of <ProjectTypeGuids> and sub types (flavors)
  • Separate implementations for C# and Visual Basic projects

The current .NET Project System is:

  • Managed and managed-interface based
  • Multi-threaded, scalable, and responsive
  • Easy to extend and compose via the Managed Extensibility Framework (MEF). Many parties, including 3rd parties, can contribute to a single project system.
  • A single implementation for C#, F# and Visual Basic projects

What is a project system?

A project system sits between a project file on disk (for example, .csproj and .vbproj) and various Visual Studio features including, but not limited to, Solution Explorer, designers, the debugger, language services, build and deployment. Almost all interaction that occurs with files contained in a project file happens through the project system.

There are many technologies that come together to make up the .NET Project System:

  • MSBuild provides the build engine and file format.
  • SDK provides the command-line interface for building, running and interacting with .NET projects, along with the necessary MSBuild tasks and targets.
  • Common Project System provides the base building blocks for the project system including (but not limited to) project tree, build and debugger coordination and Visual Studio integration.
  • Roslyn provides C# and Visual Basic language support including compilers, IntelliSense, refactorings, analyzers, and code fixes.
  • Visual F# tools provides F# language support.

image

How do I build the repository?

This repository is built on .NET Framework and requires the .NET Framework version of MSBuild to build successfully. Additionally, there is a dependency on the Visual Studio SDK as the .NET Project System is bundled as a Visual Studio Extension for deployment into Visual Studio.

Here is how to acquire the necessary components:

  • Install the latest Visual Studio
    • Select these workloads during installation:
      • .NET desktop build tools
      • Visual Studio extension development

image

After the necessary components are installed, simply run the build.cmd batch file at the root of the repository. This will build, test, and bundle the repository appropriately.

build.cmd flags

All the command line arguments provided to build.cmd get forwarded to MSBuild. There are some special properties we've set up for building this repo.

  • For Projects:
    • /p:SrcProjects=[true or false]: Includes the projects within the src directory. Default: true
    • /p:TestProjects=[true or false]: Includes the projects within the tests directory. Default: true
    • /p:SetupProjects=[true or false]: Includes the projects within the setup directory. Default: true
  • For Targets:
    • /p:Restore=[true or false]: Runs the Restore target to acquire project dependencies. Default: true
    • /p:Build=[true or false]: Runs the Build target to compile the projects into assemblies. Default: true
    • /p:Rebuild=[true or false]: Runs the Rebuild target which cleans and builds the projects. Default: false
    • /p:Test=[true or false]: Runs the Test target to execute the xUnit test projects. Default: true
    • /p:Pack=[true or false]: Runs the Pack target to bundle the projects into NuGet packages. Default: true

How do I engage and contribute?

We welcome you to try things out, file issues, make feature requests, and join us in design conversations. If you are looking for something to work on, take a look at our help wanted issues for a great place to start. Also, check out our contributing guide.

This project has adopted a code of conduct adapted from the Contributor Covenant to clarify expected behavior in our community. This code of conduct has been adopted by many other projects. For more information, see Contributors Code of conduct.

About

The .NET Project System for Visual Studio

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 99.6%
  • Other 0.4%