Skip to content

Libraries Build and VS Experience Changes #31823

@Anipik

Description

@Anipik

Libraries Build will now be using dotnet sdk outerbuild and innerbuild infrastructure to build the BCL.
Configurations.props file will no longer be required. TargetFrameworks can be directly used instead of BuildConfigurations.

I will just summarize the build and VS experience changes for the dotnet community.

Build Changes

  1. We are no longer overloading the configuration property. The only allowable configurations are Debug and Release. ConfigurationGroup property is replaced by Configuration.
  2. TargetGroup property has also been removed. We will use the Target Framework and TargetFrameworkSuffix(refers to the OSGroup in the TargetFrameworks if present) properties in the csproj file to specify the conditions. You can also still keep using TargetsWindows\Unix\Linux properties.
    BuildTargetFramework is the new property which will be used for vertical build. For Building Individual Projects, you can use either TargetFramework or BuildTargetFramework to build against a specific TargetFramework.
    The default is netcoreapp5.0.
    TargetFramework can only be used to build one project. It cannot be used to build more than one projects and it can contain an osgroup as well eg you can build the project /p:TargetFramework=netcoreapp5.0-windows_NT. It will result in sdk running only the innerBuild for specified framework.
    BuildTargetFramework can be used for a vertical build as well as for individual project build. In case of an individual project it will result in outerBuild triggering an innerBuild by setting the TargetFramework to best supported framework.
  3. BuildConfigurations are replaced by TargetFrameworks property. Currently we will always have to use TargetFrameworks property in our csprojs to specify the supported frameworks even if its only one. (TargetFramework in csproj file wont work)
  4. PackageConfigurations have also been removed. By default all TargetFrameworks will be included in the package. You can remove the TargetFramework from a package by specifically setting ExcludeFromPackage property = true for the specific targetFramework. Eg
<ExcludeFromPackage Condition="'$(TargetFramework)' != 'netstandard2.0'">true</ExcludeFromPackage>
  1. There hasn’t been any change in how we build our allConfigurations leg

VS Experience Changes

  1. Editor experience has improved as you will now able to choose the TargetFramework from the dropdown menu for individual files.
  2. By default, the vs builds all netcoreapp5.0 TargetFrameworks i.e if a project builds for netcoreapp5.0-WindowsNT, netcoreapp5.0-Unix, Building the project from the VS will result in building for both the target Frameworks.
    However, you can build for more TargetFrameworks by setting AdditionalBuildTargetFrameworks property.
  3. The testing experience is mostly the same i.e launch with -VS switch and debug or run tests using test explorer.

Some Benefits Besides Cleanup

  1. This is the first step towards enabling restore for src and ref csprojs and removing deprojs.
  2. We can use now common msbuild properties with coreclr and installer subsets eg Earlier we were using ConfigurationGroup and everything else was using Configuration.
  3. We can now enable running tests in VS for net472.
  4. The build is faster.

@ericstj @ViktorHofer @safern feel free to edit and add benefits.
PR making the change #1787

cc @danmosemsft

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions