diff --git a/eng/Packages.props b/eng/Packages.props index 6817b951611..a5f52eecb45 100644 --- a/eng/Packages.props +++ b/eng/Packages.props @@ -10,6 +10,8 @@ + + diff --git a/eng/Versions.props b/eng/Versions.props index 94f3c6786bc..0826882f7da 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -79,7 +79,7 @@ $([System.Text.RegularExpressions.Regex]::Match($([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)..\global.json')), '"dotnet": "([^"]*)"').Groups.get_Item(1)) - 4.2.0-1.22102.8 + 5.0.0-1.25277.114 10.0.0-beta.25358.3 6.15.0-preview.1.86 5.0.0-1.25361.3 diff --git a/src/Build/Microsoft.Build.csproj b/src/Build/Microsoft.Build.csproj index 0c139e64683..0c9cd1c3da9 100644 --- a/src/Build/Microsoft.Build.csproj +++ b/src/Build/Microsoft.Build.csproj @@ -38,6 +38,8 @@ + + @@ -124,9 +126,6 @@ BackEnd\Components\RequestBuilder\IntrinsicTasks\TaskLoggingHelperExtension.cs - - BuildCheck\Utilities\IsExternalInit.cs - diff --git a/src/Framework/AssemblyUtilities.cs b/src/Framework/AssemblyUtilities.cs index 5eb6e996a6e..6b21b7d22eb 100644 --- a/src/Framework/AssemblyUtilities.cs +++ b/src/Framework/AssemblyUtilities.cs @@ -10,15 +10,8 @@ using Microsoft.Build.Framework; #endif - -// Declare this to get init properties. See https://github.com/dotnet/roslyn/issues/45510#issuecomment-694977239 #nullable disable -namespace System.Runtime.CompilerServices -{ - internal static class IsExternalInit { } -} - namespace Microsoft.Build.Shared { /// diff --git a/src/Framework/Microsoft.Build.Framework.csproj b/src/Framework/Microsoft.Build.Framework.csproj index da61a612686..296bff029bd 100644 --- a/src/Framework/Microsoft.Build.Framework.csproj +++ b/src/Framework/Microsoft.Build.Framework.csproj @@ -15,7 +15,7 @@ - + @@ -29,8 +29,9 @@ - + + diff --git a/src/MSBuildTaskHost/MSBuildTaskHost.csproj b/src/MSBuildTaskHost/MSBuildTaskHost.csproj index 8512aae44f0..83345b0c8ae 100644 --- a/src/MSBuildTaskHost/MSBuildTaskHost.csproj +++ b/src/MSBuildTaskHost/MSBuildTaskHost.csproj @@ -70,6 +70,7 @@ CopyOnWriteDictionary.cs + @@ -202,6 +203,7 @@ + diff --git a/src/Framework/Polyfills/NullableAttributes.cs b/src/MSBuildTaskHost/NullableAttributes.cs similarity index 97% rename from src/Framework/Polyfills/NullableAttributes.cs rename to src/MSBuildTaskHost/NullableAttributes.cs index b6698fce618..2c086ba5622 100644 --- a/src/Framework/Polyfills/NullableAttributes.cs +++ b/src/MSBuildTaskHost/NullableAttributes.cs @@ -3,6 +3,8 @@ // This was copied from https://github.com/dotnet/runtime/blob/39b9607807f29e48cae4652cd74735182b31182e/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/NullableAttributes.cs // and updated to have the scope of the attributes be internal. +// This file is used only by MSBuildTaskHost; other projects should get the polyfills from the +// Microsoft.CodeAnalysis.Contracts package, through the Microsoft.Build.Framework project. #nullable disable diff --git a/src/Shared/IsExternalInit.cs b/src/Shared/IsExternalInit.cs index ae2ffb321cd..f0a0588d1df 100644 --- a/src/Shared/IsExternalInit.cs +++ b/src/Shared/IsExternalInit.cs @@ -1,9 +1,22 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +#if NET +using System.Runtime.CompilerServices; + +// Type-forward to the inbox class where available, in order to maintain binary compatibility +// between the .NET and .NET Standard 2.0 assemblies. +[assembly: TypeForwardedTo(typeof(IsExternalInit))] + +#else + +using System.ComponentModel; + namespace System.Runtime.CompilerServices { // Needed so we can use init setters in full fw or netstandard // (details: https://developercommunity.visualstudio.com/t/error-cs0518-predefined-type-systemruntimecompiler/1244809) + [EditorBrowsable(EditorBrowsableState.Never)] internal static class IsExternalInit { } } +#endif