Skip to content

Commit 6d0c5e5

Browse files
committed
Merge branch 'main' into FixRenameNamespaceWithUnsavedChanged
# Conflicts: # src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/Rename/FileMoveNotificationListener.cs
2 parents b47274f + fa3e9f4 commit 6d0c5e5

File tree

419 files changed

+3522
-2323
lines changed

Some content is hidden

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

419 files changed

+3522
-2323
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ root = true
88
indent_style = space
99
# (Please don't specify an indent_size here; that has too many unintended consequences.)
1010

11+
# Spell checker configuration
12+
spelling_exclusion_path = spelling.dic
13+
1114
# Code files
1215
[*.{cs,csx,vb,vbx}]
1316
indent_size = 4

ProjectSystem.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "items", "items", "{5204CAC5
6767
nuget.config = nuget.config
6868
README.md = README.md
6969
SECURITY.md = SECURITY.md
70+
spelling.dic = spelling.dic
7071
version.json = version.json
7172
EndProjectSection
7273
EndProject

docs/build-acceleration.md

Lines changed: 72 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Consider this example, where a unit test project references a project that in tu
2929

3030
Making a change in _Library 3_ and running the unit test would previously have caused four calls to MSBuild.
3131

32-
With build acceleration enabled MSBuild is called only once, after which VS copies the output of _Library 3_ to all referencing projects
32+
With build acceleration enabled MSBuild is called only once, after which VS copies the output of _Library 3_ to all referencing projects.
3333

3434
## Configuration
3535

@@ -49,9 +49,11 @@ You may disable build acceleration for specific projects in your solution by red
4949

5050
## Debugging
5151

52+
### Enable logging
53+
5254
Build acceleration runs with the FUTDC, and outputs details of its operation in the build log. To enable this logging:
5355

54-
> Tools | Options | Projects and Solutions | .NET Core
56+
> Tools | Options | Projects and Solutions | SDK-Style Projects
5557
5658
![Projects and Solutions, .NET Core options](repo/images/options.png)
5759

@@ -61,6 +63,73 @@ Setting _Logging Level_ to a value other than `None` results in messages prefixe
6163
- `Minimal` produces a single message per out-of-date project.
6264
- `Info` and `Verbose` provide increasingly detailed information about the inner workings of the check, which are useful for debugging.
6365

66+
### Validate builds are accelerated
67+
68+
If build acceleration cannot be enabled for any of the reasons given below, builds continue to work as before.
69+
70+
The following prerequisites exist for build acceleration:
71+
72+
- You are running Visual Studio 2022 version 17.5 or later.
73+
- The project is an SDK-style .NET project.
74+
- All projects it references (directly and transitively) are also SDK-style .NET projects.
75+
76+
The following steps will validate that build acceleration is working correctly for a given project.
77+
78+
1. Ensure `Verbose` logging is enabled (see [Enable logging](#enable-logging)).
79+
1. Build the project to make it up-to-date.
80+
1. Modify source of a referenced project (either a direct reference or transitive reference).
81+
1. Build the project again.
82+
83+
Looking through the build output with the following points in mind:
84+
85+
- ℹ️ If you see:
86+
87+
> This project appears to be a candidate for build acceleration. To opt in, set the 'AccelerateBuildsInVisualStudio' MSBuild property to 'true'.
88+
89+
Then the project does not specify the `AccelerateBuildsInVisualStudio` property, or its value was not `true` or `false`, and the project would likely benefit from build acceleration. If the project cannot use build acceleration for any reason, this message can be suppressed by setting the property to `false` explicitly. See [configuration](#configuration) to learn how to configure build acceleration correctly.
90+
91+
- ⛔ If you see:
92+
93+
> Build acceleration is disabled for this project via the 'AccelerateBuildsInVisualStudio' MSBuild property.
94+
95+
Then the `AccelerateBuildsInVisualStudio` property was set to `false`. Even if your build files don't set this explicitly, it could come from a `.props`/`.targets` file within a NuGet package, or be related to the project type (for example, installer projects cannot be accelerated).
96+
97+
- ⛔ If you see:
98+
99+
> Build acceleration data is unavailable for project with target 'C:\Solution\Project\bin\Debug\Project.dll'.
100+
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.
102+
103+
- 🗒️ TODO Add validation and output message when reference assemblies are not enabled (https://github.com/dotnet/project-system/issues/8798)
104+
105+
- ✅ You should see a section listing items to copy:
106+
107+
```
108+
Checking items to copy to the output directory:
109+
Checking copy items from project 'C:\Solution\Referenced\Referenced.csproj':
110+
Checking PreserveNewest item
111+
Source 2023-01-19 15:28:56.882: 'C:\Solution\Referenced\bin\Debug\net7.0\Referenced.dll'
112+
Destination 2023-01-19 15:28:37.379: 'C:\Solution\Referencing\bin\Debug\net7.0\Referenced.dll'
113+
Remembering the need to copy file 'C:\Solution\Referenced\bin\Debug\net7.0\Referenced.dll' to 'C:\Solution\Referencing\bin\Debug\net7.0\Referenced.dll'.
114+
...
115+
```
116+
117+
This indicates that build acceleration has identified a set of files to copy.
118+
119+
- ✅ You should see a section indicating that files were copied and the project was up-to-date:
120+
121+
```
122+
Copying 2 files to accelerate build:
123+
From 'C:\Solution\Library1\bin\Debug\net7.0\Library1.dll' to 'C:\Solution\Tests\bin\Debug\net7.0\Library1.dll'.
124+
From 'C:\Solution\Library1\bin\Debug\net7.0\Library1.pdb' to 'C:\Solution\Tests\bin\Debug\net7.0\Library1.pdb'.
125+
Project is up-to-date.
126+
Up-to-date check completed in 8.8 ms
127+
```
128+
129+
This indicates that rather than calling MSBuild to build the project, Visual Studio has copied the listed files directly. The check completed quickly, the project is reported as up-to-date, and the next project (if any) can start building.
130+
131+
⚠️ Note that the bug described in [Discrepancies between FUTDC logging and build summary](up-to-date-check.md#discrepancies-between-futdc-logging-and-build-summary) may cause the number of succeeded projects to be overstated. This requires changes within Visual Studio, and we hope to fix this in a future release.
132+
64133
## Limitations
65134

66135
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.
@@ -71,4 +140,4 @@ We recommend enabling build acceleration for all projects in the solution, as de
71140

72141
## Giving feedback
73142

74-
If you encounter an issue with build acceleration, please [file an issue](https://github.com/dotnet/project-system/issues/new/choose) and we will investigate whether it's something that can be addressed.
143+
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/design-time-builds.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ The `AddAdditionalReferences` target will run in both normal builds _and_ design
5757

5858
### Determining whether a target is running in a design-time build
5959

60-
Use both the `DesignTimeBuild` (CPS-based projects) and `BuildingProject` (legacy project system) properties to determine whether a target is running in a design-time build or a normal build. This can be used to avoid expensive calculations or work that is only needed for a normal build, helping to keep the IDE responsive.
60+
Checking if a target is running in a design-time build can be used to avoid expensive calculations or work that is only needed for a normal build, helping to keep the IDE responsive.
61+
62+
Different project systems use different properties to distinguish between design-time builds and normal builds. For example, the .NET Project System in this repo builds on top of the Common Project System (CPS) components, and CPS-based project systems set the `DesignTimeBuild` property. However, non-SDK-style C# and VB projects generally use what we call the "legacy" project system, and it uses the `BuildingProject` property.
63+
64+
As such, you should make use of both the `DesignTimeBuild` and `BuildingProject` properties to determine whether a target is running in a design-time build or a normal build:
6165

6266
```xml
6367
<Target Name="AddAdditionalReferences" BeforeTargets="ResolveAssemblyReferences">

docs/repo/property-pages/property-specification.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ will be added as unchecked list items.
299299
<StringProperty.ValueEditors>
300300
<ValueEditor EditorType="MultiStringSelector">
301301
<ValueEditor.Metadata>
302-
<NameValuePair Name="TypeDescriptorText" Value="Imported Namespaces" />
302+
<NameValuePair Name="TypeDescriptorText" Value="Imported Namespaces" xliff:LocalizableProperties="Value" />
303303
<NameValuePair Name="AllowsCustomStrings" Value="True" />
304304
</ValueEditor.Metadata>
305305
</ValueEditor>

docs/up-to-date-check.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ non-zero, then the check would have determined the project was not up-to-date, r
137137

138138
To debug issues with the up-to-date check, enable its logging.
139139

140-
> Tools | Options | Projects and Solutions | .NET Core
140+
> Tools | Options | Projects and Solutions | SDK-Style Projects
141141
142142
![Projects and Solutions, .NET Core options](repo/images/options.png)
143143

eng/imports/HostAgnostic.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<PackageReference Include="Nerdbank.GitVersioning" PrivateAssets="all" />
2828
<PackageReference Include="System.IO.Pipelines" ExcludeAssets="all" />
2929
<PackageReference Include="Microsoft.Net.Compilers.Toolset" />
30-
<PackageReference Include="XliffTasks" PrivateAssets="all" />
30+
<PackageReference Include="Microsoft.DotNet.XliffTasks" PrivateAssets="all" />
3131
<!-- Path Property: PkgMicrosoft_DiaSymReader_Pdb2Pdb -->
3232
<PackageReference Include="Microsoft.DiaSymReader.Pdb2Pdb" ExcludeAssets="all" GeneratePathProperty="true" />
3333
<!-- Path Property: PkgCodecov -->

eng/imports/Packages.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<PackageReference Update="Nerdbank.Streams" Version="2.9.112" />
1010
<PackageReference Update="Nerdbank.GitVersioning" Version="3.5.107" />
1111
<PackageReference Update="System.IO.Pipelines" Version="6.0.3" />
12-
<PackageReference Update="XliffTasks" Version="1.0.0-beta.20574.1" />
12+
<PackageReference Update="Microsoft.DotNet.XliffTasks" Version="1.0.0-beta.23073.2" />
1313
<!-- This is used for publishing PDBs to the legacy symbol server. It converts portable PDBs to Windows PDBs (embedded). -->
1414
<!-- https://devdiv.visualstudio.com/DevDiv/_wiki/wikis/DevDiv.wiki/672/Archive-Symbols-with-Symweb?anchor=portable-pdbs -->
1515
<PackageReference Update="Microsoft.DiaSymReader.Pdb2Pdb" Version="1.1.0-beta2-22320-02" />
@@ -46,7 +46,7 @@
4646
<PackageReference Update="Microsoft.VisualStudio.Threading" Version="17.4.16-alpha" />
4747
<PackageReference Update="Microsoft.VisualStudio.Threading.Analyzers" Version="17.4.16-alpha" />
4848
<PackageReference Update="Microsoft.VisualStudio.Utilities" Version="17.4.0-preview-3-32908-042" />
49-
<PackageReference Update="Microsoft.VisualStudio.Validation" Version="17.0.64" />
49+
<PackageReference Update="Microsoft.VisualStudio.Validation" Version="17.6.4-alpha" />
5050
<PackageReference Update="Microsoft.VisualStudio.XmlEditor" Version="17.3.32804.24" />
5151
<PackageReference Update="System.Threading.Tasks.Dataflow" Version="6.0.0" />
5252
<PackageReference Update="Microsoft.VSDesigner" Version="17.0.0-preview-2-31223-026" />

setup/Directory.Build.targets

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,13 @@
3131
<!-- Specifies the version number that is used within the 'source.extension.vsixmanifest' files for VSIX packages. -->
3232
<Target Name="GetVsixVersion" Outputs="$(BuildVersion)" Condition="'$(IsVsixProject)' == 'true'" />
3333

34+
<!--
35+
Creates the Insertion folder as the full folder path is required to create the .vsix file in CreateVsixContainer.
36+
This line will fail in the VsixUtil tool if the folder path does not exist:
37+
https://dev.azure.com/devdiv/DevDiv/_git/VSExtensibility?path=/src/product/vssdk/tools/VsixUtil/Packager.cs&version=GBdevelop&line=82&lineEnd=83&lineStartColumn=1&lineEndColumn=1&lineStyle=plain&_a=contents
38+
-->
39+
<Target Name="CreateInsertionFolder" BeforeTargets="CreateVsixContainer" Condition="'$(IsVsixProject)' == 'true'">
40+
<MakeDir Directories="$(VisualStudioSetupInsertionPath)" />
41+
</Target>
42+
3443
</Project>

setup/Microsoft.VisualStudio.ProjectSystem.Managed.CommonFiles/Microsoft.VisualStudio.ProjectSystem.Managed.CommonFiles.csproj

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@
88

99
<Import Project="..\..\eng\imports\VisualStudio.props" />
1010

11-
<PropertyGroup>
12-
<!-- This VSSDK project has custom build steps and should not be accelerated. -->
13-
<AccelerateBuildsInVisualStudio>false</AccelerateBuildsInVisualStudio>
14-
</PropertyGroup>
15-
1611
<ItemGroup>
1712
<!-- Depend on projects producing XAML rules included in this Willow package -->
1813
<ProjectReference Include="..\..\src\Microsoft.VisualStudio.ProjectSystem.Managed\Microsoft.VisualStudio.ProjectSystem.Managed.csproj" />

0 commit comments

Comments
 (0)