Skip to content

Commit 6487653

Browse files
authored
.NET projects produce a reference assembly by default (#8571)
In general we want to produce reference assemblies whenever possible, as they improve incremental build performance. Making them work end-to-end requires support from other components, such as fast up-to-date checks in VS. While support was originally added for SDK-style projects, it was not present for legacy `.csproj` files. Accordingly, `ProduceReferenceAssemblies` was set `true` only when the target framework was `net5.0` or later for C#/VB projects. Similarly, F# added support during `net7.0`, so a similar check was added for F# projects. VS 17.5 ships support for reference assemblies in the legacy CSPROJ fast up-to-date check, so all C#/VB projects are supported. Similarly, F# has full support. Consequently, it is now safe to enable the production and consumption of reference assemblies across all .NET project types, including .NET Framework, .NET Standard, .NET Core and .NET. This commit changes the default `ProduceReferenceAssembly` value to `true` for all .NET projects that don't set `ProduceOnlyReferenceAssembly`.
1 parent a478b9d commit 6487653

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Tasks/Microsoft.NET.props

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,22 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and
77
impossible to load or build your projects from the command-line or the IDE.
88
99
This file contains .NET-specific properties, and items. This file is imported for .NET Core, .NET Standard, and .NET Framework projects.
10-
these two files are used to encapsulate the multi-targeting and framework specific build process.
1110
1211
Copyright (C) Microsoft Corporation. All rights reserved.
1312
***********************************************************************************************
1413
-->
1514
<Project>
1615

16+
<!--
17+
============================================================
18+
Reference Assemblies
19+
Enable the production of a reference assembly by all .NET projects, by default.
20+
============================================================
21+
-->
22+
<PropertyGroup>
23+
<ProduceReferenceAssembly Condition=" '$(ProduceReferenceAssembly)' == '' and '$(ProduceOnlyReferenceAssembly)' != 'true' ">true</ProduceReferenceAssembly>
24+
</PropertyGroup>
25+
1726
<!--
1827
============================================================
1928
GetToolPaths

0 commit comments

Comments
 (0)