Skip to content

Commit e3d9813

Browse files
authored
Targeting netstandard 2.1 for more projects (#10190)
* NuGetServices.Validation now multi-targets. * NuGet.Services.Storage multi-targets.
1 parent a382525 commit e3d9813

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

src/NuGet.Services.Storage/NuGet.Services.Storage.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net472</TargetFramework>
4+
<TargetFrameworks>net472;netstandard2.1</TargetFrameworks>
55
<PackageVersion Condition="'$(PackageVersion)' == ''">$(CommonPackageVersion)</PackageVersion>
66
<Description>Shared server-side storage component for NuGet services</Description>
77
</PropertyGroup>

src/NuGet.Services.Validation/Entities/EntitiesConfiguration.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
// Copyright (c) .NET Foundation. All rights reserved.
1+
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System.Data.Entity;
55
using System.Data.Entity.Infrastructure;
66
using System.Data.Entity.SqlServer;
7+
#if NETFRAMEWORK
78
using System.Runtime.Remoting.Messaging;
9+
#endif
810

911
namespace NuGet.Services.Validation
1012
{
1113
public class EntitiesConfiguration : DbConfiguration
1214
{
15+
#if NETFRAMEWORK
1316
public EntitiesConfiguration()
1417
{
1518
// Configure Connection Resiliency / Retry Logic
@@ -24,5 +27,11 @@ public static bool SuspendExecutionStrategy
2427
get => (bool?)CallContext.LogicalGetData("SuspendExecutionStrategy") ?? false;
2528
set => CallContext.LogicalSetData("SuspendExecutionStrategy", value);
2629
}
30+
#else
31+
public EntitiesConfiguration()
32+
{
33+
SetExecutionStrategy("System.Data.SqlClient", () => new SqlAzureExecutionStrategy());
34+
}
35+
#endif
2736
}
2837
}

src/NuGet.Services.Validation/NuGet.Services.Validation.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net472</TargetFramework>
4+
<TargetFrameworks>net472;netstandard2.1</TargetFrameworks>
55
<PackageVersion Condition="'$(PackageVersion)' == ''">$(CommonPackageVersion)</PackageVersion>
66
<Description>Logic shared between the front-end and back-end concerning asynchronous validation</Description>
77

0 commit comments

Comments
 (0)