Skip to content

Commit 61f85d4

Browse files
committed
Merge branch 'main' into FixRenameNamespaceWithUnsavedChanged
2 parents a04dc55 + 436bc57 commit 61f85d4

File tree

141 files changed

+1026
-494
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+1026
-494
lines changed

Directory.Build.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@
132132
<Using Include="System.Collections.Immutable" />
133133
<!-- There are two namespaces via which MEF attributes are defined. This is the correct one. -->
134134
<Using Include="System.ComponentModel.Composition" />
135+
<!-- Discourage importing all of Microsoft.VisualStudio.Composition by aliasing the most common type(s) we actually use from that namespace. -->
136+
<Using Include="Microsoft.VisualStudio.Composition.ImportCardinality" Alias="ImportCardinality" />
135137
<!-- Prevent accidental use of Microsoft.VisualStudio.Threading.IAsyncDisposable -->
136138
<Using Include="System.IAsyncDisposable" Alias="IAsyncDisposable" />
137139
</ItemGroup>

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@
1010
| [17.3][173Branch] | [![173Build]][173Run] | | |
1111
| [17.4][173Branch] | [![174Build]][174Run] | [![174Compliance]][174Run] | [![174Publish]][174Run] | [![174Localization]][174Run]
1212

13-
[![Join the chat at https://gitter.im/dotnet/project-system](https://badges.gitter.im/dotnet/project-system.svg)](https://gitter.im/dotnet/project-system?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
14-
15-
This repository contains the .NET Project System for [Visual Studio](https://www.visualstudio.com/vs/) that is written on top of the [Common Project System (CPS)](https://github.com/microsoft/vsprojectsystem) 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](docs/repo/roadmap.md), 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](docs/feature-comparison.md).
13+
This repository contains the .NET Project System for [Visual Studio](https://visualstudio.microsoft.com/vs/) that is written on top of the [Common Project System (CPS)](https://github.com/microsoft/VSProjectSystem) 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](docs/repo/roadmap.md), 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](docs/feature-comparison.md).
1614

1715
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:
1816

1917
- Native and COM-based
2018
- Single threaded and bound to the UI thread
21-
- Hard to extend outside of aggregation via the use of `<ProjectTypeGuids>` and [sub types (flavors)](https://docs.microsoft.com/en-us/visualstudio/extensibility/internals/project-types)
19+
- Hard to extend outside of aggregation via the use of `<ProjectTypeGuids>` and [sub types (flavors)](https://learn.microsoft.com/visualstudio/extensibility/internals/project-types)
2220
- Separate implementations for C# and Visual Basic projects
2321

2422
The current .NET Project System is:
@@ -35,14 +33,14 @@ There are many technologies that come together to make up the .NET Project Syste
3533

3634
- [MSBuild](https://github.com/dotnet/msbuild) provides the build engine and file format.
3735
- [SDK](https://github.com/dotnet/sdk) provides the command-line interface for building, running and interacting with .NET projects, along with the necessary MSBuild tasks and targets.
38-
- [Common Project System](https://github.com/microsoft/vsprojectsystem) provides the base building blocks for the project system including (but not limited to) project tree, build and debugger coordination and Visual Studio integration.
36+
- [Common Project System](https://github.com/microsoft/VSProjectSystem) provides the base building blocks for the project system including (but not limited to) project tree, build and debugger coordination and Visual Studio integration.
3937
- [Roslyn](https://github.com/dotnet/roslyn) provides C# and Visual Basic language support including compilers, IntelliSense, refactorings, analyzers, and code fixes.
4038
- [Visual F# tools](https://github.com/dotnet/fsharp) provides F# language support.
4139

4240
![image](docs/repo/images/solution-explorer.png)
4341

4442
## How do I build the repository?
45-
This repository is built on .NET Framework and requires the .NET Framework version of [MSBuild](https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild?view=vs-2022) to build successfully. Additionally, there is a dependency on the [Visual Studio SDK](https://docs.microsoft.com/en-us/visualstudio/extensibility/starting-to-develop-visual-studio-extensions?view=vs-2022) as the .NET Project System is bundled as a Visual Studio Extension for deployment into Visual Studio.
43+
This repository is built on .NET Framework and requires the .NET Framework version of [MSBuild](https://learn.microsoft.com/visualstudio/msbuild/msbuild?view=vs-2022) to build successfully. Additionally, there is a dependency on the [Visual Studio SDK](https://learn.microsoft.com/visualstudio/extensibility/starting-to-develop-visual-studio-extensions?view=vs-2022) as the .NET Project System is bundled as a Visual Studio Extension for deployment into Visual Studio.
4644

4745
Here is how to acquire the necessary components:
4846
- Install the latest [Visual Studio](https://visualstudio.microsoft.com/downloads/)
@@ -70,7 +68,7 @@ All the command line arguments provided to **build.cmd** get forwarded to MSBuil
7068
## How do I engage and contribute?
7169
We welcome you to try things out, [file issues](https://github.com/dotnet/project-system/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](https://github.com/dotnet/project-system/issues?q=is%3Aopen+is%3Aissue+label%3A%22Help+Wanted%22) for a great place to start. Also, check out our [contributing guide](CONTRIBUTING.md).
7270

73-
This project has adopted a code of conduct adapted from the [Contributor Covenant](http://contributor-covenant.org/) to clarify expected behavior in our community. This code of conduct has been [adopted by many other projects](http://contributor-covenant.org/adopters/). For more information, see [Contributors Code of conduct](https://github.com/dotnet/home/blob/master/guidance/be-nice.md).
71+
This project has adopted a code of conduct adapted from the [Contributor Covenant](https://www.contributor-covenant.org) to clarify expected behavior in our community. This code of conduct has been [adopted by many other projects](https://www.contributor-covenant.org/adopters/). For more information, see [Contributors Code of conduct](https://github.com/dotnet/home/blob/master/guidance/be-nice.md).
7472

7573
<!-- References -->
7674

@@ -106,4 +104,4 @@ This project has adopted a code of conduct adapted from the [Contributor Covenan
106104
[174Compliance]: https://dev.azure.com/devdiv/DevDiv/_apis/build/status/DotNet/project-system/DotNet-Project-System?branchName=dev17.4.x&label=dev17.4.x&stageName=Compliance
107105
[174Publish]: https://dev.azure.com/devdiv/DevDiv/_apis/build/status/DotNet/project-system/DotNet-Project-System?branchName=dev17.4.x&label=dev17.4.x&stageName=Publish
108106
[174Localization]: https://dev.azure.com/devdiv/DevDiv/_apis/build/status/DotNet/project-system/DotNet-Project-System?branchName=dev17.4.x&label=dev17.4.x&stageName=Localization
109-
[174Run]: https://dev.azure.com/devdiv/DevDiv/_build/latest?definitionId=9675&branchName=dev17.4.x
107+
[174Run]: https://dev.azure.com/devdiv/DevDiv/_build/latest?definitionId=9675&branchName=dev17.4.x

docs/build-acceleration.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,15 @@ Looking through the build output with the following points in mind:
9898

9999
> Build acceleration data is unavailable for project with target 'C:\Solution\Project\bin\Debug\Project.dll'.
100100
101-
Then any project that references the indicated project (directy or transitively) cannot be accelerated. This can happen if the mentioned project uses the legacy `.csproj` format, or for any other project system within Visual Studio that doesn't support build acceleration. Currently only .NET SDK-style projects (loaded with the project system from this GitHub repository) provide the needed data.
101+
Then any project that references the indicated project (directly or transitively) cannot be accelerated. This can happen if the mentioned project uses the legacy `.csproj` format, or for any other project system within Visual Studio that doesn't support build acceleration. Currently only .NET SDK-style projects (loaded with the project system from this GitHub repository) provide the needed data.
102102

103-
- 🗒️ TODO Add validation and output message when reference assemblies are not enabled (https://github.com/dotnet/project-system/issues/8798)
103+
- ⛔ If you see:
104+
105+
> This project has enabled build acceleration, but not all referenced projects produce a reference assembly. Ensure projects producing the following outputs have the 'ProduceReferenceAssembly' MSBuild property set to 'true': '&lt;path1&gt;', '&lt;path2&gt;'.
106+
107+
Then build acceleration will not know whether it is safe to copy a modified output DLL from a referenced project or not. We rely on the use of reference assemblies to convey this information. To address this, ensure all referenced projects have the `ProduceReferenceAssembly` property set to `true`. You may like to add this to your `Directory.Build.props` file alongside the `AccelerateBuildsInVisualStudio` property. Note that projects targeting `net5.0` or later produce reference assemblies by default. Projects that target .NET Standard may require this to be specified manually (see https://github.com/dotnet/project-system/issues/8865).
108+
109+
This message lists the referenced projects that are not producing a reference assembly. The `TargetPath` of those projects is used, as this can help disambiguate between target frameworks in multi-targeting projects.
104110

105111
- ✅ You should see a section listing items to copy:
106112

@@ -132,12 +138,21 @@ Looking through the build output with the following points in mind:
132138

133139
## Limitations
134140

135-
MSBuild is very configurable, and there are many ways to configure a project that will prevent build acceleration from working correctly. For example, if a project's build defines post-compile steps that are important to the correct functioning of your project, then build acceleration will not correctly reproduce those steps when it bypasses MSBuild.
136-
137-
Note that NuGet packages can modify a project's build in non-obvious ways that may have undesirable interactions with build acceleration.
141+
MSBuild is very configurable, and there are ways to configure a project that will prevent build acceleration from working correctly. For example, if a project's build has post-compile steps that are important to the correct functioning of your project, then build acceleration will not correctly reproduce those steps when it bypasses MSBuild.
138142

139143
We recommend enabling build acceleration for all projects in the solution, as described above, then monitoring for any unexpected behavior. You can use the log output to verify whether build acceleration is the culprit. If so, disable it for that project.
140144

145+
Some examples of project types for which build acceleration may not work correctly:
146+
147+
- **Installer projects** &mdash; builds must package files into some output file (`.exe`, `.msi`, `.vsix`, ...).
148+
- **MAUI projects** &mdash; builds must produce a device-specific artifact for deployment.
149+
150+
Even if your solution has such a project, you should still enable build acceleration for all the other projects. Most large solutions have only one or two top-level projects like this, and many library projects that are candidates for acceleration.
151+
152+
Note that NuGet packages can modify a project's build in non-obvious ways that may have undesirable interactions with build acceleration. Theoretically a class library project having a specific NuGet package might not work with build acceleration. We are not aware of any such popular packages at this time.
153+
154+
We aim to automatically identify and disable build acceleration in cases where it won't work. Please let us know of such cases in an issue or discussion on this repo so that we can improve the feature and this documentation.
155+
141156
## Giving feedback
142157

143158
If you encounter an issue with build acceleration, please review the [open issue list](https://github.com/dotnet/project-system/issues?q=is%3Aissue+label%3AFeature-Build-Acceleration) to see whether it already exists. If so you can vote and comment on that issue. Otherwise, [file a new issue](https://github.com/dotnet/project-system/issues/new/choose) and we will investigate whether it's something that can be addressed.

docs/repo/dependencies-node-roadmap.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,44 @@ flowchart LR
6565

6666
Bold lines indicate Dataflow subscriptions.
6767

68+
## Class diagram
69+
70+
```mermaid
71+
---
72+
title: Dependencies node class diagram
73+
---
74+
%% Edit this diagram at: https://mermaid.live/edit
75+
classDiagram
76+
direction TD
77+
DependencySharedProjectsSubscriber --|> DependencyRulesSubscriberBase
78+
DependencyRulesSubscriberBase ..|> IDependencyRulesSubscriber
79+
DependencyRulesSubscriber --|> DependencyRulesSubscriberBase
80+
DependenciesSnapshotProvider --o "*" IDependencyRulesSubscriber
81+
DependenciesSnapshotProvider --o "*" IProjectDependenciesSubTreeProvider
82+
DependenciesProjectTreeProvider --o "1" DependenciesSnapshotProvider
83+
DependenciesRuleHandlerBase ..|> IDependenciesRuleHandler
84+
DependenciesRuleHandlerBase ..|> IProjectDependenciesSubTreeProvider
85+
____RuleHandler --|> DependenciesRuleHandlerBase
86+
DependencyRulesSubscriber --o "*" IDependenciesRuleHandler
87+
88+
note for ____RuleHandler "Implementations exist for all reference types.\nAnalyzer, Assembly, Analyzer, COM, Framework, Package, Project, SDK"
89+
90+
class IDependenciesRuleHandler {
91+
EvaluatedRuleName : string
92+
ResolvedRuleName : string
93+
Handle(...)
94+
}
95+
class IDependencyRulesSubscriber {
96+
DependenciesChanged : event
97+
InitializeAsync(...)
98+
}
99+
class IProjectDependenciesSubTreeProvider {
100+
DependenciesChanged : event
101+
ProviderType : string
102+
CreateRootDependencyNode() : IDependencyModel
103+
}
104+
```
105+
68106
## The CPS view of top-level dependencies
69107

70108
On the CPS side the project tree is composed of instances of the `IProjectTree` and `IProjectItemTree` interfaces. `IProjectTree` captures the structure of the tree (e.g. it has properties to access the parent and child nodes) and the "UI" aspects of the node&mdash;name, icons, visibility, etc. An `IProjectItemTree` captures all of that but also represents a concrete item within the project like a file, assembly reference, or NuGet package.

eng/pipelines/templates/analyze-api.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ jobs:
2525
patterns: |
2626
bin/Dlls/**/Microsoft.VisualStudio.AppDesigner*.pdb
2727
bin/Dlls/**/Microsoft.VisualStudio.Editors*.pdb
28-
bin/Dlls/**/Microsoft.VisualStudio.Managed*.pdb
28+
bin/Dlls/**/Microsoft.VisualStudio.ProjectSystem.Managed*.pdb
2929
bin/Dlls/**/Microsoft.VisualStudio.AppDesigner*.dll
3030
bin/Dlls/**/Microsoft.VisualStudio.Editors*.dll
31-
bin/Dlls/**/Microsoft.VisualStudio.Managed*.dll
31+
bin/Dlls/**/Microsoft.VisualStudio.ProjectSystem.Managed*.dll
3232
3333
###################################################################################################################################################################
3434
# RUN ANALYSIS

eng/pipelines/templates/analyze-compliance.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
inputs:
5050
Path: $(Build.SourcesDirectory)/artifacts/$(BuildConfiguration)/bin/Dlls/
5151
# Glob Format: https://dev.azure.com/securitytools/SecurityIntegration/_wiki/wikis/Guardian/1378/Glob-Format
52-
Targets: '**/Microsoft.VisualStudio.AppDesigner*.dll;**/Microsoft.VisualStudio.Editors*.dll;**/Microsoft.VisualStudio.Managed*.dll'
52+
Targets: '**/Microsoft.VisualStudio.AppDesigner*.dll;**/Microsoft.VisualStudio.Editors*.dll;**/Microsoft.VisualStudio.ProjectSystem.Managed*.dll'
5353
condition: succeededOrFailed()
5454

5555
# Verifies the packages (and files within) are signed appropriately.

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ExternalContracts.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE.md file in the project root for more information.
22

3-
using Microsoft.VisualStudio.Composition;
43
using Microsoft.VisualStudio.LanguageServices;
54
using Microsoft.VisualStudio.LanguageServices.ProjectSystem;
65
using Microsoft.VisualStudio.ProjectSystem;

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Build/Diagnostics/IncrementalBuildFailureDetector.IProjectChecker.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE.md file in the project root for more information.
22

3-
using Microsoft.VisualStudio.Composition;
4-
53
namespace Microsoft.VisualStudio.ProjectSystem.VS.Build.Diagnostics
64
{
75
internal sealed partial class IncrementalBuildFailureDetector

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Debug/IDebugProfileLaunchTargetsProvider.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE.md file in the project root for more information.
22

3-
using Microsoft.VisualStudio.Composition;
43
using Microsoft.VisualStudio.ProjectSystem.Debug;
54

65
namespace Microsoft.VisualStudio.ProjectSystem.VS.Debug

src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/IEnvironmentOptions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE.md file in the project root for more information.
22

3-
using Microsoft.VisualStudio.Composition;
4-
53
namespace Microsoft.VisualStudio.ProjectSystem.VS
64
{
75
/// <summary>

0 commit comments

Comments
 (0)