Skip to content

Commit da6d5ae

Browse files
authored
Improve SDKAnalysisLevel guidance (#6989)
1 parent a0a0a22 commit da6d5ae

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

docs/feature-guide.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,16 @@ Therefore the following logic should apply anywhere NuGet needs to make a decisi
136136
This means that `SdkAnalysisLevel` is used as intended for SDK style projects, but non-SDK style project always use the latest defaults.
137137
All project types use the same configuration, so that customers can set a single property in a *Directory.Build.props* file, or environment variable.
138138

139+
##### SDKAnalysisLevel and restore
140+
141+
The SDKAnalysisLevel feature should be used with special care in features that ship simultaneously in .NET SDK and Visual Studio.
142+
For example, when running a restore on an .NET SDK project in Visual Studio, the Visual Studio shipped code and targets will be used.
143+
When running a restore on the same project with the .NET CLI, the .NET SDK code will be used.
144+
145+
Because of this, consider the [.NET SDK loading rules](https://learn.microsoft.com/en-us/dotnet/core/porting/versioning-sdk-msbuild-vs#targeting-and-support-rules).
146+
While Visual Studio 18.0, shipped with .NET 10.0.100 SDK, the minimum version for that .NET SDK is 17.14.
147+
What that means is that if a feature is available in the NuGet targets in 17.14, it will be enabled by default in 17.14, despite the fact that you may have only intended it to be enabled by default in .NET 10 only.
148+
139149
#### Restore considerations
140150

141151
* NuGet tool parity, ensure all products work as expected
@@ -150,6 +160,7 @@ All project types use the same configuration, so that customers can set a single
150160
* Performance considerations
151161
* How is incremental restore affected?
152162
* How is full restore affected?
163+
* Consider [SDKAnalysisLevel](#sdkanalysislevel-and-restore)
153164

154165
#### Pack considerations
155166

0 commit comments

Comments
 (0)