|
1 | 1 | ---
|
2 | 2 | title: MSBuild properties for Microsoft.NET.Sdk
|
3 | 3 | 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 |
5 | 5 | ms.topic: reference
|
6 | 6 | ms.custom: updateeachrelease
|
7 | 7 | ---
|
@@ -58,6 +58,37 @@ The `ApiCompatValidateAssemblies` property enables a series of validations on th
|
58 | 58 | </PropertyGroup>
|
59 | 59 | ```
|
60 | 60 |
|
| 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 | + |
61 | 92 | ## Framework properties
|
62 | 93 |
|
63 | 94 | The following MSBuild properties are documented in this section:
|
@@ -107,37 +138,6 @@ Use the `NetStandardImplicitPackageVersion` property when you want to specify a
|
107 | 138 | </PropertyGroup>
|
108 | 139 | ```
|
109 | 140 |
|
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 |
| - |
141 | 141 | ## Package properties
|
142 | 142 |
|
143 | 143 | - [Descriptive properties](#descriptive-properties)
|
@@ -1419,6 +1419,26 @@ The `RunWorkingDirectory` property defines the working directory for the applica
|
1419 | 1419 | </PropertyGroup>
|
1420 | 1420 | ```
|
1421 | 1421 |
|
| 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 | + |
1422 | 1442 | ## Test project–related properties
|
1423 | 1443 |
|
1424 | 1444 | The following MSBuild properties are documented in this section:
|
|
0 commit comments