Skip to content

Commit d288afa

Browse files
authored
Add SdkAnalysisLevel property (#43377)
1 parent e70ed2a commit d288afa

File tree

1 file changed

+52
-32
lines changed

1 file changed

+52
-32
lines changed

docs/core/project-sdk/msbuild-props.md

Lines changed: 52 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: MSBuild properties for Microsoft.NET.Sdk
33
description: Reference for the MSBuild properties and items that are understood by the .NET SDK.
4-
ms.date: 12/01/2023
4+
ms.date: 11/07/2024
55
ms.topic: reference
66
ms.custom: updateeachrelease
77
---
@@ -58,6 +58,37 @@ The `ApiCompatValidateAssemblies` property enables a series of validations on th
5858
</PropertyGroup>
5959
```
6060

61+
## Assembly attribute properties
62+
63+
- [GenerateAssemblyInfo](#generateassemblyinfo)
64+
- [GeneratedAssemblyInfoFile](#generatedassemblyinfofile)
65+
66+
### GenerateAssemblyInfo
67+
68+
The `GenerateAssemblyInfo` property controls `AssemblyInfo` attribute generation for the project. The default value is `true`. Use `false` to disable generation of the file:
69+
70+
```xml
71+
<PropertyGroup>
72+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
73+
</PropertyGroup>
74+
```
75+
76+
The [GeneratedAssemblyInfoFile](#generatedassemblyinfofile) setting controls the name of the generated file.
77+
78+
When the `GenerateAssemblyInfo` value is `true`, [package-related project properties](#package-properties) are transformed into assembly attributes.
79+
80+
For more information about generating assembly attributes using a project file, see [Set assembly attributes in a project file](../../standard/assembly/set-attributes-project-file.md).
81+
82+
### GeneratedAssemblyInfoFile
83+
84+
The `GeneratedAssemblyInfoFile` property defines the relative or absolute path of the generated assembly info file. Defaults to a file named *[project-name].AssemblyInfo.[cs|vb]* in the `$(IntermediateOutputPath)` (usually the *obj*) directory.
85+
86+
```xml
87+
<PropertyGroup>
88+
<GeneratedAssemblyInfoFile>assemblyinfo.cs</GeneratedAssemblyInfoFile>
89+
</PropertyGroup>
90+
```
91+
6192
## Framework properties
6293

6394
The following MSBuild properties are documented in this section:
@@ -107,37 +138,6 @@ Use the `NetStandardImplicitPackageVersion` property when you want to specify a
107138
</PropertyGroup>
108139
```
109140

110-
## Assembly attribute properties
111-
112-
- [GenerateAssemblyInfo](#generateassemblyinfo)
113-
- [GeneratedAssemblyInfoFile](#generatedassemblyinfofile)
114-
115-
### GenerateAssemblyInfo
116-
117-
The `GenerateAssemblyInfo` property controls `AssemblyInfo` attribute generation for the project. The default value is `true`. Use `false` to disable generation of the file:
118-
119-
```xml
120-
<PropertyGroup>
121-
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
122-
</PropertyGroup>
123-
```
124-
125-
The [GeneratedAssemblyInfoFile](#generatedassemblyinfofile) setting controls the name of the generated file.
126-
127-
When the `GenerateAssemblyInfo` value is `true`, [package-related project properties](#package-properties) are transformed into assembly attributes.
128-
129-
For more information about generating assembly attributes using a project file, see [Set assembly attributes in a project file](../../standard/assembly/set-attributes-project-file.md).
130-
131-
### GeneratedAssemblyInfoFile
132-
133-
The `GeneratedAssemblyInfoFile` property defines the relative or absolute path of the generated assembly info file. Defaults to a file named *[project-name].AssemblyInfo.[cs|vb]* in the `$(IntermediateOutputPath)` (usually the *obj*) directory.
134-
135-
```xml
136-
<PropertyGroup>
137-
<GeneratedAssemblyInfoFile>assemblyinfo.cs</GeneratedAssemblyInfoFile>
138-
</PropertyGroup>
139-
```
140-
141141
## Package properties
142142

143143
- [Descriptive properties](#descriptive-properties)
@@ -1419,6 +1419,26 @@ The `RunWorkingDirectory` property defines the working directory for the applica
14191419
</PropertyGroup>
14201420
```
14211421

1422+
## SDK-related properties
1423+
1424+
The following MSBuild properties are documented in this section:
1425+
1426+
- [SdkAnalysisLevel](#sdkanalysislevel)
1427+
1428+
### SdkAnalysisLevel
1429+
1430+
Introduced in .NET 9, the `SdkAnalysisLevel` property can be used to configure how *strict* SDK tooling is. It helps you manage SDK warning levels in situations where you might not be able to pin SDKs via *global.json* or other means. You can use this property to tell a newer SDK to behave as if it were an older SDK, with regards to a specific tool or feature, without having to install the older SDK.
1431+
1432+
The allowed values of this property are SDK feature bands, for example, 8.0.100 and 8.0.400. The value defaults to the SDK feature band of the running SDK. For example, for SDK 9.0.102, the value would be 9.0.100. (For information about how the .NET SDK is versioned, see [How .NET is versioned](../versions/index.md).)
1433+
1434+
```xml
1435+
<PropertyGroup>
1436+
<SdkAnalysisLevel>8.0.400</SdkAnalysisLevel>
1437+
</PropertyGroup>
1438+
```
1439+
1440+
For more information, see [SDK Analysis Level Property and Usage](https://github.com/dotnet/designs/blob/main/proposed/sdk-analysis-level.md).
1441+
14221442
## Test project&ndash;related properties
14231443

14241444
The following MSBuild properties are documented in this section:

0 commit comments

Comments
 (0)