You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert

57
59
@@ -61,6 +63,73 @@ Setting _Logging Level_ to a value other than `None` results in messages prefixe
61
63
-`Minimal` produces a single message per out-of-date project.
62
64
-`Info` and `Verbose` provide increasingly detailed information about the inner workings of the check, which are useful for debugging.
63
65
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':
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
+
64
133
## Limitations
65
134
66
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.
@@ -71,4 +140,4 @@ We recommend enabling build acceleration for all projects in the solution, as de
71
140
72
141
## Giving feedback
73
142
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.
Copy file name to clipboardExpand all lines: docs/design-time-builds.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,11 @@ The `AddAdditionalReferences` target will run in both normal builds _and_ design
57
57
58
58
### Determining whether a target is running in a design-time build
59
59
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:
Copy file name to clipboardExpand all lines: setup/Microsoft.VisualStudio.ProjectSystem.Managed.CommonFiles/Microsoft.VisualStudio.ProjectSystem.Managed.CommonFiles.csproj
0 commit comments