[ArPow] Add NuGet.Client (#11489)

* [main] Update dependencies from dotnet/sdk (#11565)

[main] Update dependencies from dotnet/sdk
- Coherency Updates:
  - Microsoft.AspNetCore.App.Ref: from 6.0.0-rc.1.21417.2 to 6.0.0-rc.1.21417.8 (parent: Microsoft.NET.Sdk)
  - Microsoft.AspNetCore.App.Ref.Internal: from 6.0.0-rc.1.21417.2 to 6.0.0-rc.1.21417.8 (parent: Microsoft.NET.Sdk)
  - Microsoft.AspNetCore.App.Runtime.win-x64: from 6.0.0-rc.1.21417.2 to 6.0.0-rc.1.21417.8 (parent: Microsoft.NET.Sdk)
  - VS.Redist.Common.AspNetCore.SharedFramework.x64.6.0: from 6.0.0-rc.1.21417.2 to 6.0.0-rc.1.21417.8 (parent: Microsoft.NET.Sdk)
  - dotnet-dev-certs: from 6.0.0-rc.1.21417.2 to 6.0.0-rc.1.21417.8 (parent: Microsoft.NET.Sdk)
  - dotnet-user-secrets: from 6.0.0-rc.1.21417.2 to 6.0.0-rc.1.21417.8 (parent: Microsoft.NET.Sdk)

* Update dependencies from https://github.com/dotnet/sdk build 20210817.21 (#11569)

[main] Update dependencies from dotnet/sdk
- Coherency Updates:
  - Microsoft.NET.Test.Sdk: from 17.0.0-preview-20210817-01 to 17.0.0-preview-20210817-02 (parent: Microsoft.NET.Sdk)

* Update dependencies from https://github.com/dotnet/arcade build 20210817.1 (#11570)

[main] Update dependencies from dotnet/arcade
- Coherency Updates:
  - Microsoft.SourceLink.GitHub: from 1.1.0-beta-21309-01 to 1.1.0-beta-21416-05 (parent: Microsoft.DotNet.Arcade.Sdk)
  - Microsoft.DotNet.XliffTasks: from 1.0.0-beta.21412.1 to 1.0.0-beta.21414.1 (parent: Microsoft.DotNet.Arcade.Sdk)

* [ArPow] Add runtime repo to tarball (#11506)

* Add runtime repo / update runtime project

* Update runtime-portable logs and properties

* Create runtime-portable git-info

* Fix unpack of IntermediatePackages

* Re-enable references to runtime

* Pass TargetRid and NonPortable to runtime build

* Only build allconfigurations in non-portable build

* Add SDK patch to disable new CA warning

* Increase built tarball timeout

* Update prebuilt version

* Remove 5.0.3xx and preview 7
Add rc1, 6.0 daily, and move main to 7.0

* Removing 7.0 for now as there aren't builds yet.

* Update dependencies from https://github.com/dotnet/arcade build 20210818.12 (#11594)

[main] Update dependencies from dotnet/arcade
- Coherency Updates:
  - Microsoft.SourceLink.GitHub: from 1.1.0-beta-21416-05 to 1.1.0-beta-21417-01 (parent: Microsoft.DotNet.Arcade.Sdk)
  - Microsoft.DotNet.XliffTasks: from 1.0.0-beta.21414.1 to 1.0.0-beta.21417.1 (parent: Microsoft.DotNet.Arcade.Sdk)

* [ArPow] Add installer repo to tarball (#11483)

* Fix the rc2 aka.ms links

* Add NuGet

* Make safe repo name safer.

* some more props filename stuff

* Patches to get the repo to build

* Use NuGet build script instead of manually calling msbuild.

* Add patch for source-build in build.sh in nuget.

* Use existing 5.0 nuget patch.

* Fixes for build scripts and .NET 6 SDK upgrade.

* Remove obsolete patch - this was caused by not using the correct source-build SDK.

* Address code review comment for source-build build script.

* Restore reference from installer to NuGet.

* Fix patch not applying.

* Don't try to pass Arcade build args to MSBuild.

* Fix script typo.

* Patch NuGet.Frameworks to produce netstandard2.0 for VSTest.

* Did this patch the wrong way around.

* Ignore  failure in no-network case

* UPdate prebuilts version.

Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Dan Seefeldt <dseefeld@microsoft.com>
Co-authored-by: Marc Paine <marcpop@microsoft.com>
Co-authored-by: Michael Simons <msimons@microsoft.com>
Co-authored-by: Matt Galbraith <mattgal@microsoft.com>
This commit is contained in:
Chris Rummel 2021-08-24 15:01:06 -05:00 committed by GitHub
parent 7c4b93e5b7
commit f3ea71b28f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 400 additions and 58 deletions

View file

@ -37,6 +37,11 @@
<Sha>cdc5faeda066a83b084c96b8a455ad0a5e8713ab</Sha>
<SourceBuild RepoName="msbuild" ManagedOnly="true" />
</Dependency>
<Dependency Name="NuGet.Build.Tasks" Version="6.0.0-preview.3.179" CoherentParentDependency="Microsoft.NET.Sdk">
<Uri>https://github.com/nuget/nuget.client</Uri>
<Sha>7363366401b43f4ea250394db8dad3707e9a9636</Sha>
<SourceBuild RepoName="nuget-client" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.0.0-2.21356.1" CoherentParentDependency="Microsoft.NET.Sdk">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>d16c8bd011951d9bd15809d9004276cf7baaa786</Sha>

View file

@ -159,7 +159,7 @@
<MicrosoftBuildFrameworkVersion>15.7.179</MicrosoftBuildFrameworkVersion>
<MicrosoftBuildUtilitiesCoreVersion>15.7.179</MicrosoftBuildUtilitiesCoreVersion>
<PrivateSourceBuiltArtifactsPackageVersion>0.1.0-6.0.100-bootstrap.11</PrivateSourceBuiltArtifactsPackageVersion>
<PrivateSourceBuiltPrebuiltsPackageVersion>0.1.0-6.0.100-16</PrivateSourceBuiltPrebuiltsPackageVersion>
<PrivateSourceBuiltPrebuiltsPackageVersion>0.1.0-6.0.100-17</PrivateSourceBuiltPrebuiltsPackageVersion>
</PropertyGroup>
<!-- Workload manifest package versions -->
<PropertyGroup>

View file

@ -60,8 +60,8 @@ namespace Microsoft.DotNet.SourceBuild.Tasks
}))
{
string repoName = GetDefaultRepoNameFromUrl(dependency.Uri);
string safeRepoName = repoName.Replace("-", "");
string propsPath = Path.Combine(SourceBuildMetadataDir, $"{repoName}.props");
string safeRepoName = repoName.Replace("-", "").Replace(".", "");
string propsPath = Path.Combine(SourceBuildMetadataDir, $"{repoName.Replace(".", "-")}.props");
DerivedVersion derivedVersion = GetVersionInfo(dependency.Version, "0");
var repoProps = new Dictionary<string, string>
{

View file

@ -23,6 +23,6 @@
<PropertyGroup>
<PrivateSourceBuiltArtifactsPackageVersion>0.1.0-6.0.100-bootstrap.11</PrivateSourceBuiltArtifactsPackageVersion>
<PrivateSourceBuiltPrebuiltsPackageVersionPrefix>0.1.0-6.0.100-</PrivateSourceBuiltPrebuiltsPackageVersionPrefix>
<PrivateSourceBuiltPrebuiltsPackageVersionSuffix>16</PrivateSourceBuiltPrebuiltsPackageVersionSuffix>
<PrivateSourceBuiltPrebuiltsPackageVersionSuffix>17</PrivateSourceBuiltPrebuiltsPackageVersionSuffix>
</PropertyGroup>
</Project>

View file

@ -0,0 +1,31 @@
From 335f32e48fd5604cdb1340ec04d6503a3e43d783 Mon Sep 17 00:00:00 2001
From: Michael Simons <msimons@microsoft.com>
Date: Tue, 17 Aug 2021 21:09:35 +0000
Subject: [PATCH] Don't use PublicApiAnalyzer on source-build
CSC : warning AD0001: Analyzer 'Microsoft.CodeAnalysis.PublicApiAnalyzers.DeclarePublicApiAnalyzer' threw an exception of type 'System.NullReferenceException' with message 'Object reference not set to an instance of an object.'.
CSC : error CS2001: Source file '/repos/installer2/artifacts/tarball/src/nuget-client.7363366401b43f4ea250394db8dad3707e9a9636/src/NuGet.Core/NuGet.Common/PublicAPI/net6.0/PublicAPI.Shipped.txt' could not be found.
---
build/common.targets | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/build/common.targets b/build/common.targets
index 2c387f576..cf5a70c62 100644
--- a/build/common.targets
+++ b/build/common.targets
@@ -65,6 +65,11 @@
<None Include="$(MSBuildThisFileDirectory)..\icon.png" Pack="true" PackagePath="\" Visible="false" />
</ItemGroup>
+ <!-- Don't use PublicApiAnalyzer on source-build .NET -->
+ <PropertyGroup Condition=" '$(IsBuildOnlyXPLATProjects)' == 'true' ">
+ <UsePublicApiAnalyzer>false</UsePublicApiAnalyzer>
+ </PropertyGroup>
+
<!-- Projects we pack become public APIs that others can use -->
<PropertyGroup Condition=" '$(IsBuildOnlyXPLATProjects)' != 'true' and '$(PackProject)' == 'true' ">
<UsePublicApiAnalyzer Condition=" '$(UsePublicApiAnalyzer)' == '' " >true</UsePublicApiAnalyzer>
--
2.29.2

View file

@ -0,0 +1,53 @@
From e0e1d72dfa8881244a76c3dbcc63aa73c05546f4 Mon Sep 17 00:00:00 2001
From: Michael Simons <msimons@microsoft.com>
Date: Tue, 17 Aug 2021 21:13:07 +0000
Subject: [PATCH] Update netcoreapp TFMs to 6.0
---
build/common.project.props | 10 +++++-----
build/common.targets | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/build/common.project.props b/build/common.project.props
index 80433ed60..8acc4e0bb 100644
--- a/build/common.project.props
+++ b/build/common.project.props
@@ -13,17 +13,17 @@
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
<NETFXTargetFrameworkVersion>v4.7.2</NETFXTargetFrameworkVersion>
<NETFXTargetFramework>net472</NETFXTargetFramework>
- <NETCoreTargetFramework>netcoreapp2.1</NETCoreTargetFramework>
+ <NETCoreTargetFramework>net6.0</NETCoreTargetFramework>
<NETCoreTestTargetFramework>netcoreapp5.0</NETCoreTestTargetFramework>
<IsBuildOnlyXPLATProjects>$(DotNetBuildFromSource)</IsBuildOnlyXPLATProjects>
- <NetStandardVersion>netstandard2.0</NetStandardVersion>
+ <NetStandardVersion>net6.0</NetStandardVersion>
<TargetFrameworksExe>$(NETFXTargetFramework);$(NETCoreTargetFramework)</TargetFrameworksExe>
<TargetFrameworksExe Condition="'$(IsBuildOnlyXPLATProjects)' == 'true' OR '$(IsXPlat)' == 'true'">$(NETCoreTargetFramework)</TargetFrameworksExe>
- <TargetFrameworksExeForSigning>$(TargetFrameworksExe);netcoreapp5.0</TargetFrameworksExeForSigning>
- <TargetFrameworksExeForSigning Condition=" '$(IsXPlat)' == 'true' ">$(NETCoreTargetFramework);netcoreapp5.0</TargetFrameworksExeForSigning>
+ <TargetFrameworksExeForSigning>$(TargetFrameworksExe);net6.0</TargetFrameworksExeForSigning>
+ <TargetFrameworksExeForSigning Condition=" '$(IsXPlat)' == 'true' ">$(NETCoreTargetFramework);net6.0</TargetFrameworksExeForSigning>
<TargetFrameworksLibrary>$(NETFXTargetFramework);$(NetStandardVersion)</TargetFrameworksLibrary>
<TargetFrameworksLibrary Condition="'$(IsBuildOnlyXPLATProjects)' == 'true'">$(NetStandardVersion)</TargetFrameworksLibrary>
- <TargetFrameworksLibraryForSigning>$(TargetFrameworksLibrary);netcoreapp5.0</TargetFrameworksLibraryForSigning>
+ <TargetFrameworksLibraryForSigning>$(TargetFrameworksLibrary);net6.0</TargetFrameworksLibraryForSigning>
<RepositoryRootDirectory>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'README.md'))\</RepositoryRootDirectory>
<BuildCommonDirectory>$(RepositoryRootDirectory)build\</BuildCommonDirectory>
<SolutionFile>$(RepositoryRootDirectory)$(RepositoryName).sln</SolutionFile>
diff --git a/build/common.targets b/build/common.targets
index cf5a70c62..8827686a7 100644
--- a/build/common.targets
+++ b/build/common.targets
@@ -6,7 +6,7 @@
<IsDesktop>true</IsDesktop>
</PropertyGroup>
- <PropertyGroup Condition=" $(TargetFramework.StartsWith('netcoreapp')) OR $(TargetFramework.StartsWith('netstandard')) ">
+ <PropertyGroup Condition=" $(TargetFramework.StartsWith('netcoreapp')) OR $(TargetFramework.StartsWith('netstandard')) OR '$(TargetFramework)' == 'net6.0' ">
<DefineConstants>$(DefineConstants);IS_CORECLR</DefineConstants>
<IsCore>true</IsCore>
</PropertyGroup>
--
2.29.2

View file

@ -0,0 +1,43 @@
From fecc40e502197e65804177b2aec49a7a5422ed6e Mon Sep 17 00:00:00 2001
From: Davis Goodin <dagood@microsoft.com>
Date: Thu, 10 Dec 2020 16:17:55 -0600
Subject: [PATCH 3/5] Use source-built Microsoft.Web.Xdt &
System.ComponentModel.Composition
---
build/packages.targets | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/build/packages.targets b/build/packages.targets
index 6f72ac3fd..8317f3903 100644
--- a/build/packages.targets
+++ b/build/packages.targets
@@ -15,6 +15,12 @@
<XunitVersion>2.4.1</XunitVersion>
</PropertyGroup>
+ <!-- source-build-relevant package versions -->
+ <PropertyGroup>
+ <MicrosoftWebXdtPackageVersion Condition="'$(MicrosoftWebXdtPackageVersion)' == ''">3.0.0</MicrosoftWebXdtPackageVersion>
+ <SystemComponentModelCompositionPackageVersion Condition="'$(SystemComponentModelCompositionPackageVersion)' == ''">4.5.0</SystemComponentModelCompositionPackageVersion>
+ </PropertyGroup>
+
<ItemGroup>
<!-- PackageDownload -->
<PackageDownload Update="Microsoft.Build" Version="[15.1.262-preview5]" />
@@ -42,10 +48,10 @@
<PackageReference Update="Microsoft.VisualStudio.VCProjectEngine" Version="$(VSFrameworkVersion)" />
<PackageReference Update="Microsoft.VisualStudio.Workspace.VSIntegration" Version="17.0.7-preview-0001-g5492e466a9" />
<PackageReference Update="Microsoft.VSSDK.BuildTools" Version="17.0.1600" />
- <PackageReference Update="Microsoft.Web.Xdt" Version="3.0.0" />
+ <PackageReference Update="Microsoft.Web.Xdt" Version="$(MicrosoftWebXdtPackageVersion)" />
<PackageReference Update="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
<PackageReference Update="SharpZipLib" Version="1.3.2" />
- <PackageReference Update="System.ComponentModel.Composition" Version="4.5.0" />
+ <PackageReference Update="System.ComponentModel.Composition" Version="$(SystemComponentModelCompositionPackageVersion)" />
<!--
The Microsoft.VisualStudio.SDK metapackage brings in System.Threading.Tasks.Dataflow 4.11.1 (assembly version 4.9.5.0).
However, our MSBuild integration tests use Microsoft.Build 16.8.0, which requires System.Threading.Tasks.Dataflow 4.9.0 (assembly version 4.9.3.0).
--
2.18.0

View file

@ -0,0 +1,88 @@
From 9e35a4d319f3288a50bdaf5b32661764761aa0e9 Mon Sep 17 00:00:00 2001
From: Chris Rummel <crummel@microsoft.com>
Date: Thu, 19 Aug 2021 10:59:36 -0500
Subject: [PATCH 4/5] Build script changes to support ArPow from tarball.
---
eng/source-build/build.sh | 27 +++++++++++++++++++++++++--
eng/source-build/source-build.proj | 6 ++++--
2 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/eng/source-build/build.sh b/eng/source-build/build.sh
index 3bb69b2b0..aaff8ef0f 100755
--- a/eng/source-build/build.sh
+++ b/eng/source-build/build.sh
@@ -13,6 +13,25 @@ while [[ -h $source ]]; do
[[ $source != /* ]] && source="$scriptroot/$source"
done
+
+while [[ $# > 0 ]]; do
+ lowerI="$(echo $1 | awk '{print tolower($0)}')"
+ case $lowerI in
+ --configuration|-c)
+ configuration=$2
+ shift
+ ;;
+ -*)
+ # just eat this so we don't try to pass it along to MSBuild
+ export DOTNET_CORESDK_NOPRETTYPRINT=1
+ ;;
+ *)
+ args="$args $1"
+ ;;
+ esac
+ shift
+done
+
function ReadGlobalVersion {
local key=$1
local global_json_file="$scriptroot/global.json"
@@ -40,8 +59,12 @@ function GetNuGetPackageCachePath {
fi
}
-export DOTNET=${DOTNET:-dotnet}
+if [[ "$DOTNET" == "" && "$DOTNET_PATH" != "" ]]; then
+ export DOTNET="$DOTNET_PATH/dotnet"
+else
+ export DOTNET=${DOTNET:-dotnet}
+fi
ReadGlobalVersion Microsoft.DotNet.Arcade.Sdk
export ARCADE_VERSION=$_ReadGlobalVersion
-"$DOTNET" msbuild "$scriptroot/source-build.proj" /p:DotNetBuildFromSource=true /p:ArcadeBuildFromSource=true "/p:RepoRoot=$scriptroot/../../" "/bl:$scriptroot/../../artifacts/source-build/self/log/source-build.binlog"
+"$DOTNET" msbuild "$scriptroot/source-build.proj" /p:Configuration=$configuration /p:DotNetBuildFromSource=true /p:ArcadeBuildFromSource=true "/p:RepoRoot=$scriptroot/../../" "/bl:$scriptroot/../../artifacts/source-build/self/log/source-build.binlog" $args
diff --git a/eng/source-build/source-build.proj b/eng/source-build/source-build.proj
index 6f90f9793..91ea2d032 100644
--- a/eng/source-build/source-build.proj
+++ b/eng/source-build/source-build.proj
@@ -4,6 +4,8 @@
<PropertyGroup>
<ProjectRoot>$(MSBuildThisFileDirectory)../../</ProjectRoot>
+ <ArcadeDir Condition="'$(SOURCE_BUILT_SDK_DIR_ARCADE)' != ''">$(SOURCE_BUILT_SDK_DIR_ARCADE)/tools/</ArcadeDir>
+ <ArcadeDir Condition="'$(ArcadeDir)' == ''">$(NuGetPackageRoot)/microsoft.dotnet.arcade.sdk/$(ARCADE_VERSION)/tools/</ArcadeDir>
</PropertyGroup>
<Target Name="Build" DependsOnTargets="SourceBuildPostBuild">
@@ -18,14 +20,14 @@
<Target Name="SourceBuildPostBuild" DependsOnTargets="SourceBuildInnerBuild">
<Message Text="Running source-build PostBuild target" Importance="High" />
- <MSbuild Projects="$(NuGetPackageRoot)/microsoft.dotnet.arcade.sdk/$(ARCADE_VERSION)/tools/Build.proj"
+ <MSbuild Projects="$(ArcadeDir)/Build.proj"
Properties="_NETCORE_ENGINEERING_TELEMETRY=AfterSourceBuild;ArcadeBuildFromSource=true;Restore=true;Build=false;Pack=false;Publish=false;Rebuild=false;Test=false;IntegrationTest=false;PerformanceTest=false;PreventPrebuiltBuild=false;BaseInnerSourceBuildCommand=echo skipping internal build with args: "
Targets="Execute"
/>
<Message Text="Finished restoring Arcade" Importance="High" />
- <MSbuild Projects="$(NuGetPackageRoot)/microsoft.dotnet.arcade.sdk/$(ARCADE_VERSION)/tools/SourceBuild/AfterSourceBuild.proj"
+ <MSbuild Projects="$(ArcadeDir)/SourceBuild/AfterSourceBuild.proj"
Properties="_NETCORE_ENGINEERING_TELEMETRY=AfterSourceBuild;ArcadeBuildFromSource=true;CurrentRepoSourceBuildArtifactsPackagesDir=$(ProjectRoot)artifacts/nupkgs/"
/>
--
2.18.0

View file

@ -0,0 +1,138 @@
From d3c633ad00408b2b6122b70d9a152d1ab79c8378 Mon Sep 17 00:00:00 2001
From: Chris Rummel <crummel@microsoft.com>
Date: Thu, 19 Aug 2021 11:01:04 -0500
Subject: [PATCH 2/2] Upgrade to .NET 6 SDK.
---
.../NuGet.Commands/SignCommand/CertificateProvider.cs | 4 ++--
.../NuGet.Packaging/Signing/Authoring/SignPackageRequest.cs | 2 ++
src/NuGet.Core/NuGet.Packaging/Signing/Cms/NativeUtility.cs | 2 ++
src/NuGet.Core/NuGet.Protocol/Converters/JsonExtensions.cs | 2 +-
.../HttpSource/HttpRequestMessageExtensions.cs | 6 +++---
.../NuGet.Protocol/HttpSource/HttpRetryHandler.cs | 2 +-
.../HttpSource/HttpSourceAuthenticationHandler.cs | 2 +-
7 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/src/NuGet.Core/NuGet.Commands/SignCommand/CertificateProvider.cs b/src/NuGet.Core/NuGet.Commands/SignCommand/CertificateProvider.cs
index c6ea71243..beac41889 100644
--- a/src/NuGet.Core/NuGet.Commands/SignCommand/CertificateProvider.cs
+++ b/src/NuGet.Core/NuGet.Commands/SignCommand/CertificateProvider.cs
@@ -115,7 +115,7 @@ public static async Task<X509Certificate2Collection> GetCertificatesAsync(Certif
return resultCollection;
}
-
+#pragma warning disable CS1998
private static async Task<X509Certificate2> LoadCertificateFromFileAsync(CertificateSourceOptions options)
{
X509Certificate2 cert;
@@ -154,7 +154,7 @@ private static async Task<X509Certificate2> LoadCertificateFromFileAsync(Certifi
return cert;
}
-
+#pragma warning restore CS1998
private static X509Certificate2Collection LoadCertificateFromStore(CertificateSourceOptions options)
{
X509Certificate2Collection resultCollection = null;
diff --git a/src/NuGet.Core/NuGet.Packaging/Signing/Authoring/SignPackageRequest.cs b/src/NuGet.Core/NuGet.Packaging/Signing/Authoring/SignPackageRequest.cs
index e0cfae99f..ce19f2d6e 100644
--- a/src/NuGet.Core/NuGet.Packaging/Signing/Authoring/SignPackageRequest.cs
+++ b/src/NuGet.Core/NuGet.Packaging/Signing/Authoring/SignPackageRequest.cs
@@ -98,7 +98,9 @@ protected virtual void Dispose(bool disposing)
Chain?.Dispose();
#if IS_SIGNING_SUPPORTED
+#pragma warning disable CA1416
PrivateKey?.Dispose();
+#pragma warning restore CA1416
#endif
}
diff --git a/src/NuGet.Core/NuGet.Packaging/Signing/Cms/NativeUtility.cs b/src/NuGet.Core/NuGet.Packaging/Signing/Cms/NativeUtility.cs
index 565ac60b7..d57e38a65 100644
--- a/src/NuGet.Core/NuGet.Packaging/Signing/Cms/NativeUtility.cs
+++ b/src/NuGet.Core/NuGet.Packaging/Signing/Cms/NativeUtility.cs
@@ -120,7 +120,9 @@ internal static SignedCms NativeSign(CmsSigner cmsSigner, byte[] data, CngKey pr
signerInfo.cbSize = (uint)Marshal.SizeOf(signerInfo);
signerInfo.pCertInfo = MarshalUtility.PtrToStructure<CERT_CONTEXT>(cmsSigner.Certificate.Handle).pCertInfo;
+#pragma warning disable CA1416
signerInfo.hCryptProvOrhNCryptKey = privateKey.Handle.DangerousGetHandle();
+#pragma warning restore CA1416
signerInfo.HashAlgorithm.pszObjId = cmsSigner.DigestAlgorithm.Value;
if (cmsSigner.SignerIdentifierType == SubjectIdentifierType.SubjectKeyIdentifier)
diff --git a/src/NuGet.Core/NuGet.Protocol/Converters/JsonExtensions.cs b/src/NuGet.Core/NuGet.Protocol/Converters/JsonExtensions.cs
index 53fcd4cbd..b77b634fd 100644
--- a/src/NuGet.Core/NuGet.Protocol/Converters/JsonExtensions.cs
+++ b/src/NuGet.Core/NuGet.Protocol/Converters/JsonExtensions.cs
@@ -23,7 +23,7 @@ public static class JsonExtensions
{
new NuGetVersionConverter(),
new VersionInfoConverter(),
- new StringEnumConverter { CamelCaseText = false },
+ new StringEnumConverter(),
new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal },
new FingerprintsConverter(),
new VersionRangeConverter()
diff --git a/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpRequestMessageExtensions.cs b/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpRequestMessageExtensions.cs
index 7c9595268..1ca751850 100644
--- a/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpRequestMessageExtensions.cs
+++ b/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpRequestMessageExtensions.cs
@@ -34,7 +34,7 @@ internal static HttpRequestMessage Clone(this HttpRequestMessage request)
clone.Headers.TryAddWithoutValidation(header.Key, header.Value);
}
-#if NET5_0
+#if NET5_0 || NET6_0
var clonedOptions = (IDictionary<string, object>)clone.Options;
foreach (var option in request.Options)
{
@@ -118,7 +118,7 @@ public static void SetConfiguration(this HttpRequestMessage request, HttpRequest
throw new ArgumentNullException(nameof(configuration));
}
-#if NET5_0
+#if NET5_0 || NET6_0
request.Options.Set(new HttpRequestOptionsKey<HttpRequestMessageConfiguration>(NuGetConfigurationKey), configuration);
#else
request.Properties[NuGetConfigurationKey] = configuration;
@@ -128,7 +128,7 @@ public static void SetConfiguration(this HttpRequestMessage request, HttpRequest
private static T GetProperty<T>(this HttpRequestMessage request, string key)
{
-#if NET5_0
+#if NET5_0 || NET6_0
if (request.Options.TryGetValue<T>(new HttpRequestOptionsKey<T>(key), out T result))
#else
object result;
diff --git a/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpRetryHandler.cs b/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpRetryHandler.cs
index 67a1726b6..0534e936e 100644
--- a/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpRetryHandler.cs
+++ b/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpRetryHandler.cs
@@ -81,7 +81,7 @@ public class HttpRetryHandler : IHttpRetryHandler
headerStopwatch = new Stopwatch();
stopwatches.Add(headerStopwatch);
}
-#if NET5_0
+#if NET5_0 || NET6_0
requestMessage.Options.Set(new HttpRequestOptionsKey<List<Stopwatch>>(StopwatchPropertyName), stopwatches);
#else
requestMessage.Properties[StopwatchPropertyName] = stopwatches;
diff --git a/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpSourceAuthenticationHandler.cs b/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpSourceAuthenticationHandler.cs
index b9ab58ce7..ebf738e52 100644
--- a/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpSourceAuthenticationHandler.cs
+++ b/src/NuGet.Core/NuGet.Protocol/HttpSource/HttpSourceAuthenticationHandler.cs
@@ -98,7 +98,7 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
{
List<Stopwatch> stopwatches = null;
-#if NET5_0
+#if NET5_0 || NET6_0
if (request.Options.TryGetValue(
new HttpRequestOptionsKey<List<Stopwatch>>(HttpRetryHandler.StopwatchPropertyName),
out stopwatches))
--
2.18.0

View file

@ -0,0 +1,25 @@
From 612f18bace3320572dc69b3ee56c0d942c29331f Mon Sep 17 00:00:00 2001
From: Chris Rummel <crummel@microsoft.com>
Date: Fri, 20 Aug 2021 15:30:52 -0500
Subject: [PATCH] Build NuGet.Frameworks for netstandard as well for VSTest.
---
src/NuGet.Core/NuGet.Frameworks/NuGet.Frameworks.csproj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/NuGet.Core/NuGet.Frameworks/NuGet.Frameworks.csproj b/src/NuGet.Core/NuGet.Frameworks/NuGet.Frameworks.csproj
index 65f261dc1..ed81ecf24 100644
--- a/src/NuGet.Core/NuGet.Frameworks/NuGet.Frameworks.csproj
+++ b/src/NuGet.Core/NuGet.Frameworks/NuGet.Frameworks.csproj
@@ -4,7 +4,7 @@
<PropertyGroup>
<Description>NuGet's understanding of target frameworks.</Description>
- <TargetFrameworks>$(TargetFrameworksLibrary)</TargetFrameworks>
+ <TargetFrameworks>$(TargetFrameworksLibrary);netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition="'$(IsBuildOnlyXPLATProjects)' != 'true'">$(TargetFrameworks);net40</TargetFrameworks>
<TargetFramework />
<NoWarn>$(NoWarn);CS1591;CS1574;CS1573</NoWarn>
--
2.18.0

View file

@ -503,7 +503,7 @@
<SourceBuiltNupkgFiles Include="$(SourceBuiltPackagesPath)extractArtifacts/**/artifacts/*.nupkg" />
</ItemGroup>
<Copy
<Move
Condition="'@(SourceBuiltNupkgFiles)' != ''"
SourceFiles="@(SourceBuiltNupkgFiles)"
DestinationFiles="@(SourceBuiltNupkgFiles -> '$(_NupkgDestinationPath)%(Filename)%(Extension)')" />
@ -513,7 +513,7 @@
<SourceBuiltAssetFiles Remove="$(SourceBuiltPackagesPath)extractArtifacts/**/artifacts/*.nupkg" />
</ItemGroup>
<Copy
<Move
Condition="'@(SourceBuiltAssetFiles)' != ''"
SourceFiles="@(SourceBuiltAssetFiles)"
DestinationFiles="@(SourceBuiltAssetFiles -> '$(SourceBuiltAssetsDir)%(Filename)%(Extension)')" />

View file

@ -62,8 +62,7 @@
<RepositoryReference Include="fsharp" />
<RepositoryReference Include="msbuild" />
<RepositoryReference Include="source-build" />
<!-- TODO: https://github.com/dotnet/source-build/issues/2279
<RepositoryReference Include="nuget-client" /> -->
<RepositoryReference Include="nuget-client" />
<RepositoryReference Include="roslyn" />
<RepositoryReference Include="runtime" />
<RepositoryReference Include="sdk" />

View file

@ -53,6 +53,7 @@
<!-- Tier 4 -->
<RepositoryReference Include="aspnetcore" />
<RepositoryReference Include="nuget-client" />
<!-- Tier 5 -->
<RepositoryReference Include="fsharp" />

View file

@ -1,14 +1,7 @@
<Project>
<PropertyGroup>
<SourceDirectory>nuget.client</SourceDirectory>
</PropertyGroup>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<PropertyGroup>
<NuGetCoreSourceDirectory>$(ProjectDirectory)src/NuGet.Core/</NuGetCoreSourceDirectory>
<ToolsDirectory>$(ProjectDirectory)cli/</ToolsDirectory>
<NuGetKeyFilePath>$(KeysDir)NuGet.Client.snk</NuGetKeyFilePath>
<RepoApiImplemented>false</RepoApiImplemented>
<DependencyVersionInputRepoApiImplemented>true</DependencyVersionInputRepoApiImplemented>
@ -18,50 +11,17 @@
<ItemGroup>
<EnvironmentVariables Include="MS_PFX_PATH=$(NuGetKeyFilePath)" />
<EnvironmentVariables Include="NUGET_PFX_PATH=$(NuGetKeyFilePath)" />
<RepositoryReference Include="common" />
<RepositoryReference Include="newtonsoft-json" />
<RepositoryReference Include="source-build" />
<RepositoryReference Include="msbuild" />
<RepositoryReference Include="aspnet-xdt" />
<RepositoryReference Include="xdt" />
</ItemGroup>
<PropertyGroup>
<BuildCommandArgs>$(StandardSourceBuildArgs)</BuildCommandArgs>
<BuildCommand>$(ProjectDirectory)eng/source-build/build$(ShellExtension) $(BuildCommandArgs)</BuildCommand>
</PropertyGroup>
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
<Target Name="RepoBuild">
<PropertyGroup>
<BuildCommandBase>$(DotnetToolCommand) msbuild $(ProjectDirectory)/build/build.proj</BuildCommandBase>
<BuildCommandBase>$(BuildCommandBase) /p:VisualStudioVerion=15.0</BuildCommandBase>
<BuildCommandBase>$(BuildCommandBase) /p:Configuration=$(Configuration)</BuildCommandBase>
<BuildCommandBase>$(BuildCommandBase) /p:BuildRTM=false</BuildCommandBase>
<BuildCommandBase>$(BuildCommandBase) /p:BuildNumber=$(OfficialBuildId)</BuildCommandBase>
<BuildCommandBase>$(BuildCommandBase) /v:$(LogVerbosity)</BuildCommandBase>
<BuildCommandBase>$(BuildCommandBase) /p:TreatWarningsAsErrors=false</BuildCommandBase>
<BuildCommandBase>$(BuildCommandBase) /p:DotNetPackageVersionPropsPath=$(PackageVersionPropsPath)</BuildCommandBase>
</PropertyGroup>
<Exec Command="$(BuildCommandBase) /t:RestoreXPLAT /bl:restore.binlog $(RedirectRepoOutputToLog)"
EnvironmentVariables="@(EnvironmentVariables)"
WorkingDirectory="$(ProjectDirectory)"
IgnoreStandardErrorWarningFormat="true" />
<Exec Command="$(BuildCommandBase) /t:BuildXPLAT /bl:build.binlog $(RedirectRepoOutputToLog)"
EnvironmentVariables="@(EnvironmentVariables)"
WorkingDirectory="$(ProjectDirectory)"
IgnoreStandardErrorWarningFormat="true" />
<PropertyGroup>
<PackCommand>$(BuildCommandBase) /t:PackXPlat</PackCommand>
<PackCommand>$(PackCommand) /p:PackageOutputPath=$(PackagesOutput)</PackCommand>
<PackCommand>$(PackCommand) /p:NoPackageAnalysis=true</PackCommand>
<PackCommand>$(PackCommand) /flp:v=detailed</PackCommand>
<PackCommand>$(PackCommand) /v:$(LogVerbosity)</PackCommand>
<PackCommand>$(PackCommand) /bl:pack.binlog</PackCommand>
<PackCommand>$(PackCommand) $(RedirectRepoOutputToLog)</PackCommand>
</PropertyGroup>
<Exec Command="$(PackCommand)"
EnvironmentVariables="@(EnvironmentVariables)"
WorkingDirectory="$(ProjectDirectory)"
IgnoreStandardErrorWarningFormat="true" />
</Target>
</Project>

View file

@ -38,8 +38,7 @@
<RepositoryReference Include="runtime" />
<RepositoryReference Include="msbuild" />
<RepositoryReference Include="source-build" />
<!-- TODO: https://github.com/dotnet/source-build/issues/2279
<RepositoryReference Include="nuget-client" /> -->
<RepositoryReference Include="nuget-client" />
<RepositoryReference Include="roslyn-analyzers" />
<RepositoryReference Include="vstest" />
<RepositoryReference Include="fsharp" />