Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Targeting netstandard 2.1 for more projects #10190

Merged
merged 2 commits into from
Sep 24, 2024
Merged

Targeting netstandard 2.1 for more projects #10190

merged 2 commits into from
Sep 24, 2024

Conversation

agr
Copy link
Contributor

@agr agr commented Sep 21, 2024

Internal projects targeting .net depend on those packages and produce build warnings because of unsupported targets. Nothing really prevents those from targeting netstandard 2.1 (not netstandard2.0 because of EF).

Had to apply a fix to Validation DB's EntitiesConfiguration similar to what we have for Gallery DB:

#if NETFRAMEWORK
using System.Runtime.Remoting.Messaging;
#endif
namespace NuGetGallery
{
public class EntitiesConfiguration
: DbConfiguration
{
#if NETFRAMEWORK
public EntitiesConfiguration()
{
// Configure Connection Resiliency / Retry Logic
// See https://msdn.microsoft.com/en-us/data/dn456835.aspx and msdn.microsoft.com/en-us/data/dn307226
SetExecutionStrategy("System.Data.SqlClient", () => SuspendExecutionStrategy
? (IDbExecutionStrategy)new DefaultExecutionStrategy() : new SqlAzureExecutionStrategy());
}
public static bool SuspendExecutionStrategy
{
get
{
return (bool?)CallContext.LogicalGetData("SuspendExecutionStrategy") ?? false;
}
set
{
CallContext.LogicalSetData("SuspendExecutionStrategy", value);
}
}
#else
public EntitiesConfiguration()
{
// Configure Connection Resiliency / Retry Logic
// See https://msdn.microsoft.com/en-us/data/dn456835.aspx and msdn.microsoft.com/en-us/data/dn307226
SetExecutionStrategy("System.Data.SqlClient", () => new SqlAzureExecutionStrategy());
}
#endif

Functionally, there are no changes for projects consuming those that target net472 and projects targeting .net can actually now use those.

@agr agr requested a review from a team as a code owner September 21, 2024 00:22
@erdembayar
Copy link
Contributor

@agr
Please add related issue link if you have one?

@agr agr merged commit e3d9813 into dev Sep 24, 2024
2 checks passed
@agr agr deleted the agr-mt branch September 24, 2024 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants