|
5 | 5 | * [Controlling verbosity](#controlling-verbosity)
|
6 | 6 | * [Config XML schema](#config-xml-schema)
|
7 | 7 | * [Config XML schema support in Visual Studio](#config-xml-schema-support-in-visual-studio)
|
8 |
| -* [Machine-wide MSBuild integration](#machine-wide-msbuild-integration) |
| 8 | +* [NsDepCop ServiceHost](#nsdepcop-servicehost) |
| 9 | +* [Machine-wide MSBuild integration (Deprecated)](#machine-wide-msbuild-integration) |
9 | 10 |
|
10 | 11 |
|
11 | 12 | ## Dependency rules
|
@@ -195,10 +196,21 @@ Add NsDepCop config XML schema to the Visual Studio schema cache to get validati
|
195 | 196 | * [NsDepCopCatalog.xml](../source/NsDepCop.ConfigSchema/NsDepCopCatalog.xml)
|
196 | 197 | * [NsDepCopConfig.xsd](../source/NsDepCop.ConfigSchema/NsDepCopConfig.xsd)
|
197 | 198 |
|
198 |
| -## Machine-wide MSBuild integration |
| 199 | +## NsDepCop ServiceHost |
| 200 | +NsDepCop NuGet package **v1.7.1** have introduced the NsDepCop ServiceHost to improve build performance. |
| 201 | +* It runs in the background as a standalone process, communicates via named pipes and serves requests coming from NsDepCopTask instances running inside MSBuild processes. |
| 202 | +* It is started automatically when needed by an NsDepCopTask and quits automatically when the MSBuild process that started it exits. |
| 203 | +* By running continuously it avoids the repeated startup times which is significant. |
| 204 | + |
| 205 | +You can control the lifetime of NsDepCop ServiceHost by controlling the lifetime of the MSBuild processes by modifying the **MSBUILDDISABLENODEREUSE** environment variable. |
| 206 | +* If you set it to 0 then new MSBuild processes are started for each build and they exit when the build finishes. So do NsDepCop ServiceHost. |
| 207 | +* If you set it to **1** then MSBuild processes are kept alive until the Visual Studio instance that started them exits. **This option gives the best build (and NsDepCop) performance.** |
| 208 | + |
| 209 | +## Machine-wide MSBuild integration (Deprecated) |
199 | 210 | * This is a legacy option in the MSI installer and requires admin privilege.
|
200 | 211 | * Hooks into the MSBuild C# build process by modifying the "Custom.After.Microsoft.CSharp.targets" file. It does not modify any C# project files.
|
201 | 212 | * Runs NsDepCop when building any C# project that has a config.nsdepcop file.
|
| 213 | + |
202 | 214 | * The drawback of this method is that you have to install the tool on every environment where you want to use it.
|
203 | 215 | * The NuGet (per-project MSBuild integration) approach is much better because that works in every environment with zero install: the tool gets pulled down by the nuget package restore.
|
204 | 216 |
|
0 commit comments