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

Remove netstandard1.5 from some projects #2279

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Grpc.Auth/Grpc.Auth.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<IsGrpcPublishedPackage>true</IsGrpcPublishedPackage>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TargetFrameworks>net462;netstandard1.5;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/Grpc.Core.Api/Grpc.Core.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<IsGrpcPublishedPackage>true</IsGrpcPublishedPackage>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TargetFrameworks>net462;netstandard1.5;netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0;netstandard2.1</TargetFrameworks>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, netstandard2.1 isn't listed in the recommended list of frameworks in #2278 (which makes this PR only a partial fix), so I'm not sure if not updating it was intentional or not.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That may just be my fault when reporting the issue. I'm personally okay with it supporting netstandard2.1 as well, as that doesn't add any burden on dependencies (which need to support netstandard2.0 anyway).

<PackageReadmeFile>README.md</PackageReadmeFile>

<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
12 changes: 0 additions & 12 deletions src/Grpc.Core.Api/Internal/ClientDebuggerHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ namespace Grpc.Core.Internal;

internal static class ClientDebuggerHelpers
{
#if NETSTANDARD1_5
private static TypeInfo? GetParentType(Type clientType)
#else
private static Type? GetParentType(Type clientType)
#endif
{
// Attempt to get the parent type for a generated client.
// A generated client is always nested inside a static type that contains information about the client.
Expand All @@ -48,11 +44,7 @@ internal static class ClientDebuggerHelpers
return null;
}

#if NETSTANDARD1_5
var parentType = clientType.DeclaringType.GetTypeInfo();
#else
var parentType = clientType.DeclaringType;
#endif
// Check parent type is static. A C# static type is sealed and abstract.
if (parentType == null || (!parentType.IsSealed && !parentType.IsAbstract))
{
Expand Down Expand Up @@ -101,10 +93,6 @@ internal static class ClientDebuggerHelpers
return methods;

static bool IsMethodField(FieldInfo field) =>
#if NETSTANDARD1_5
typeof(IMethod).GetTypeInfo().IsAssignableFrom(field.FieldType);
#else
typeof(IMethod).IsAssignableFrom(field.FieldType);
#endif
}
}
2 changes: 1 addition & 1 deletion src/Grpc.HealthCheck/Grpc.HealthCheck.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<IsGrpcPublishedPackage>true</IsGrpcPublishedPackage>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TargetFrameworks>net462;netstandard1.5;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/Grpc.Reflection/Grpc.Reflection.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<IsGrpcPublishedPackage>true</IsGrpcPublishedPackage>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TargetFrameworks>net462;netstandard1.5;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

Expand Down