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

add target framework variable #2532

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<Import Project="build\version.props" />

<PropertyGroup>
<NetCoreAppCurrent>net9.0</NetCoreAppCurrent>
<NetCoreAppPrevious>net8.0</NetCoreAppPrevious>
<NetCoreAppMinimum>net6.0</NetCoreAppMinimum>
<NetFrameworkMinimum>net462</NetFrameworkMinimum>

<!-- Set versions for all projects. Avoids warnings from non-preview projects referencing preview projects -->
<Version>$(GrpcDotnetVersion)</Version>
<AssemblyVersion>$(GrpcDotnetAssemblyVersion)</AssemblyVersion>
Expand Down
4 changes: 2 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<MicrosoftAspNetCoreAppPackageVersion>9.0.0-preview.5.24306.11</MicrosoftAspNetCoreAppPackageVersion>
<MicrosoftAspNetCoreApp8PackageVersion>8.0.6</MicrosoftAspNetCoreApp8PackageVersion>
<MicrosoftAspNetCoreApp7PackageVersion>7.0.5</MicrosoftAspNetCoreApp7PackageVersion>
<MicrosoftAspNetCoreApp6PackageVersion>6.0.33</MicrosoftAspNetCoreApp6PackageVersion>
<GrpcDotNetPackageVersion>2.63.0</GrpcDotNetPackageVersion>
<OpenTelemetryPackageVersion>1.6.0</OpenTelemetryPackageVersion>
<OpenTelemetryIntergationPackageVersion>1.8.1</OpenTelemetryIntergationPackageVersion>
<OpenTelemetryGrpcPackageVersion>1.8.0-beta.1</OpenTelemetryGrpcPackageVersion>
<MicrosoftExtensionsPackageVersion>9.0.0-preview.5.24306.7</MicrosoftExtensionsPackageVersion>
<MicrosoftExtensionsLtsPackageVersion>6.0.0</MicrosoftExtensionsLtsPackageVersion>
<MicrosoftExtensions8PackageVersion>8.0.0</MicrosoftExtensions8PackageVersion>
<MicrosoftExtensions6PackageVersion>6.0.0</MicrosoftExtensions6PackageVersion>
</PropertyGroup>
<ItemGroup>
<!-- ASP.NET Core -->
Expand Down
10 changes: 1 addition & 9 deletions nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
<add key="dotnet7" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json" />
<add key="dotnet8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json" />
<add key="dotnet9" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json" />
<add key="grpc" value="https://grpc.jfrog.io/grpc/api/nuget/v3/grpc-nuget-dev" />
</packageSources>
Expand All @@ -17,17 +15,11 @@
<packageSource key="dotnet-core">
<package pattern="*" />
</packageSource>
<packageSource key="dotnet7">
<package pattern="*" />
</packageSource>
<packageSource key="dotnet8">
<package pattern="*" />
</packageSource>
<packageSource key="dotnet9">
<package pattern="*" />
</packageSource>
<packageSource key="grpc">
<package pattern="*" />
</packageSource>
</packageSourceMapping>
</configuration>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<OutputType>Exe</OutputType>
<!-- Uncomment line below to enable gRPC-Web on the server -->
<DefineConstants Condition="'$(EnableGrpcWeb)' == 'true'">$(DefineConstants);GRPC_WEB</DefineConstants>
Expand Down Expand Up @@ -41,7 +41,6 @@
<!-- TODO: Workaround https://github.com/dotnet/sdk/issues/28169. Remove when fixed. -->
<ItemGroup Condition="'$(PublishAot)'!='true'">
<ProjectReference Include="..\..\..\src\Grpc.AspNetCore.Server\Grpc.AspNetCore.Server.csproj" />
<ProjectReference Include="..\..\..\src\Grpc.AspNetCore.Web\Grpc.AspNetCore.Web.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(PublishAot)'=='true'">
<PackageReference Include="Grpc.AspNetCore.Server" />
Expand Down
6 changes: 2 additions & 4 deletions perf/benchmarkapps/GrpcClient/GrpcClient.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<OutputType>Exe</OutputType>
<DefineConstants Condition="'$(EnableGrpcWeb)' == 'true'">$(DefineConstants);GRPC_WEB</DefineConstants>
<!-- Enable server GC to more closely simulate a microservice app making calls -->
Expand All @@ -19,9 +19,7 @@
<Compile Include="..\..\..\test\Shared\HttpEventSourceListener.cs" Link="HttpEventSourceListener.cs" />

<PackageReference Include="Microsoft.Crank.EventSources" />
<PackageReference Include="Microsoft.Extensions.Logging" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="System.CommandLine" />

<PackageReference Include="Google.Protobuf" />
Expand Down
2 changes: 1 addition & 1 deletion perf/benchmarkapps/GrpcCoreServer/GrpcCoreServer.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<OutputType>Exe</OutputType>
</PropertyGroup>

Expand Down
7 changes: 2 additions & 5 deletions perf/benchmarkapps/QpsWorker/QpsWorker.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\src\Grpc.AspNetCore.Server.Reflection\Grpc.AspNetCore.Server.Reflection.csproj" />
<ProjectReference Include="..\..\..\src\Grpc.AspNetCore.Server\Grpc.AspNetCore.Server.csproj" />
<ProjectReference Include="..\..\..\src\Grpc.Net.Client\Grpc.Net.Client.csproj" />

<PackageReference Include="Google.Protobuf" />
<PackageReference Include="Grpc.Tools" PrivateAssets="All" />

<Compile Include="..\Shared\BenchmarkServiceImpl.cs" Link="Services\BenchmarkServiceImpl.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<IsGrpcPublishedPackage>true</IsGrpcPublishedPackage>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum)</TargetFrameworks>

<!-- Disable analysis for ConfigureAwait(false) -->
<WarningsNotAsErrors>$(WarningsNotAsErrors);CA2007</WarningsNotAsErrors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<IsGrpcPublishedPackage>true</IsGrpcPublishedPackage>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum)</TargetFrameworks>

<!-- Disable analysis for ConfigureAwait(false) -->
<WarningsNotAsErrors>$(WarningsNotAsErrors);CA2007</WarningsNotAsErrors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<IsGrpcPublishedPackage>true</IsGrpcPublishedPackage>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum)</TargetFrameworks>

<!-- Disable analysis for ConfigureAwait(false) -->
<WarningsNotAsErrors>$(WarningsNotAsErrors);CA2007</WarningsNotAsErrors>
Expand All @@ -15,7 +15,6 @@

<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Google.Protobuf" />

<ProjectReference Include="..\Grpc.AspNetCore.Server\Grpc.AspNetCore.Server.csproj" />
<ProjectReference Include="..\Grpc.Reflection\Grpc.Reflection.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion src/Grpc.AspNetCore.Server/Grpc.AspNetCore.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<IsGrpcPublishedPackage>true</IsGrpcPublishedPackage>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum)</TargetFrameworks>
<PackageReadmeFile>README.md</PackageReadmeFile>

<!-- Disable analysis for ConfigureAwait(false) -->
Expand Down
2 changes: 1 addition & 1 deletion src/Grpc.AspNetCore.Web/Grpc.AspNetCore.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<IsGrpcPublishedPackage>true</IsGrpcPublishedPackage>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum)</TargetFrameworks>
<PackageReadmeFile>README.md</PackageReadmeFile>

<!-- Disable analysis for ConfigureAwait(false) -->
Expand Down
2 changes: 1 addition & 1 deletion src/Grpc.AspNetCore/Grpc.AspNetCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<PackageTags>gRPC RPC HTTP/2 aspnetcore</PackageTags>

<IsGrpcPublishedPackage>true</IsGrpcPublishedPackage>
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum)</TargetFrameworks>
<PackageReadmeFile>README.md</PackageReadmeFile>

<!-- Don't include empty DLL or PDB in metapackage -->
Expand Down
Empty file removed src/Grpc.AspNetCore/lib/net7.0/_._
Empty file.
4 changes: 2 additions & 2 deletions 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;netstandard2.0</TargetFrameworks>
<TargetFrameworks>$(NetFrameworkMinimum);netstandard2.0</TargetFrameworks>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

Expand All @@ -21,7 +21,7 @@
<PackageReference Include="Google.Apis.Auth" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net462' ">
<ItemGroup Condition=" '$(TargetFramework)' == '$(NetFrameworkMinimum)' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
Expand Down
7 changes: 2 additions & 5 deletions src/Grpc.Core.Api/AsyncStreamReaderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

#endregion

using System;
using System.Threading;
using System.Threading.Tasks;
using Grpc.Shared;

namespace Grpc.Core;

Expand All @@ -39,10 +39,7 @@ public static class AsyncStreamReaderExtensions
public static Task<bool> MoveNext<T>(this IAsyncStreamReader<T> streamReader)
where T : class
{
if (streamReader == null)
{
throw new ArgumentNullException(nameof(streamReader));
}
ArgumentNullThrowHelper.ThrowIfNull(streamReader);

return streamReader.MoveNext(CancellationToken.None);
}
Expand Down
3 changes: 2 additions & 1 deletion src/Grpc.Core.Api/DeserializationContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#endregion

using System;
using System.Buffers;

namespace Grpc.Core;

Expand Down Expand Up @@ -58,7 +59,7 @@ public virtual byte[] PayloadAsNewBuffer()
/// (as there is no practical reason for doing so) and <c>DeserializationContext</c> implementations are free to assume so.
/// </summary>
/// <returns>read only sequence containing the entire payload.</returns>
public virtual System.Buffers.ReadOnlySequence<byte> PayloadAsReadOnlySequence()
public virtual ReadOnlySequence<byte> PayloadAsReadOnlySequence()
{
throw new NotImplementedException();
}
Expand Down
9 changes: 6 additions & 3 deletions 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;netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);$(NetFrameworkMinimum);netstandard2.0</TargetFrameworks>
<PackageReadmeFile>README.md</PackageReadmeFile>

<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand All @@ -17,13 +17,16 @@
<None Include="README.md" Pack="true" PackagePath="\" />

<Compile Include="..\Shared\CodeAnalysisAttributes.cs" Link="Internal\CodeAnalysisAttributes.cs" />
<Compile Include="..\Shared\NullableAttributes.cs" Link="Internal\NullableAttributes.cs" />
<Compile Include="..\Shared\CallerArgumentExpressionAttribute.cs" Link="Internal\CallerArgumentExpressionAttribute.cs" />
<Compile Include="..\Shared\ThrowHelpers\ArgumentNullThrowHelper.cs" Link="Internal\ArgumentNullThrowHelper.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'netstandard2.1'">
<ItemGroup Condition=" '$(TargetFramework)' == '$(NetFrameworkMinimum)' or '$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Memory" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net462' ">
<ItemGroup Condition=" '$(TargetFramework)' == '$(NetFrameworkMinimum)' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Grpc.Core.Api/IAsyncStreamWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public interface IAsyncStreamWriter<in T>
/// <param name="message">The message to be written. Cannot be null.</param>
Task WriteAsync(T message);

#if NETSTANDARD2_1_OR_GREATER || NET5_0_OR_GREATER
#if NET6_0_OR_GREATER
/// <summary>
/// Writes a message asynchronously. Only one write can be pending at a time.
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions src/Grpc.Core.Api/Internal/ClientDebuggerHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ internal static class ClientDebuggerHelpers
var fields = parentType.GetFields(BindingFlags.Static | BindingFlags.NonPublic);
foreach (var field in fields)
{
if (IsMethodField(field))
if (IsMethodField(field) && field.GetValue(null) is IMethod method)
{
methods.Add((IMethod)field.GetValue(null));
methods.Add(method);
}
}
return methods;
Expand Down
6 changes: 3 additions & 3 deletions 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;netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);$(NetFrameworkMinimum);netstandard2.0</TargetFrameworks>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

Expand All @@ -24,11 +24,11 @@
<Protobuf Include="health.proto" GrpcServices="Both" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'netstandard2.0'">
<ItemGroup Condition=" '$(TargetFramework)' == '$(NetFrameworkMinimum)' or '$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Threading.Channels" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net462' ">
<ItemGroup Condition=" '$(TargetFramework)' == '$(NetFrameworkMinimum)' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Grpc.Net.Client.Web/Grpc.Net.Client.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<IsGrpcPublishedPackage>true</IsGrpcPublishedPackage>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);netstandard2.0;</TargetFrameworks>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions src/Grpc.Net.Client.Web/Internal/Base64RequestStream.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#region Copyright notice and license
#region Copyright notice and license

// Copyright 2019 The gRPC Authors
//
Expand Down Expand Up @@ -88,7 +88,7 @@ public override async ValueTask WriteAsync(ReadOnlyMemory<byte> data, Cancellati

EnsureSuccess(
Base64.EncodeToUtf8(data.Span.Slice(0, encodeLength), localBuffer.Span, out var bytesConsumed, out var bytesWritten, isFinalBlock: false),
#if NETSTANDARD2_1 || NETSTANDARD2_0
#if NETSTANDARD2_0
OperationStatus.NeedMoreData
#else
// React to fix https://github.com/dotnet/runtime/pull/281
Expand Down
23 changes: 15 additions & 8 deletions src/Grpc.Net.Client/Grpc.Net.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,33 @@

<IsGrpcPublishedPackage>true</IsGrpcPublishedPackage>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TargetFrameworks>net462;netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);$(NetFrameworkMinimum);netstandard2.0</TargetFrameworks>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462' OR '$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netstandard2.1'">
<ItemGroup Condition="'$(TargetFramework)'=='$(NetCoreAppCurrent)'">
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='$(NetCoreAppPrevious)'">
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" VersionOverride="$(MicrosoftExtensions8PackageVersion)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='$(NetCoreAppMinimum)'">
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" VersionOverride="$(MicrosoftExtensions6PackageVersion)" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == '$(NetFrameworkMinimum)' OR '$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<ItemGroup Condition="'$(TargetFramework)' == '$(NetFrameworkMinimum)'">
<PackageReference Include="System.Net.Http.WinHttpHandler" />
</ItemGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net7.0' OR '$(TargetFramework)' == 'net8.0'">
<PropertyGroup Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)' OR '$(TargetFramework)' == '$(NetCoreAppPrevious)' OR '$(TargetFramework)' == '$(NetCoreAppMinimum)'">
<DefineConstants>SUPPORT_LOAD_BALANCING;$(DefineConstants)</DefineConstants>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" VersionOverride="$(MicrosoftExtensionsLtsPackageVersion)" />
</ItemGroup>

<ItemGroup>
<Using Include="System.Net.Http" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Grpc.Net.Client/Internal/ClientStreamWriterBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected ClientStreamWriterBase(ILogger logger)

public Task WriteAsync(TRequest message) => WriteCoreAsync(message, CancellationToken.None);

#if NETSTANDARD2_1_OR_GREATER || NET5_0_OR_GREATER
#if NET6_0_OR_GREATER
// Explicit implementation because this WriteAsync has a default interface implementation.
Task IAsyncStreamWriter<TRequest>.WriteAsync(TRequest message, CancellationToken cancellationToken)
{
Expand Down
Loading