Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Revert "Fix shared code"
This reverts commit 770a146.
  • Loading branch information
JamesNK committed Jun 13, 2025
commit 609f157ea2c45698ab59e86b58cede54712fd4e5
17 changes: 8 additions & 9 deletions src/Grpc.AspNetCore.Server/Grpc.AspNetCore.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@
<Compile Include="..\Shared\CommonGrpcProtocolHelpers.cs" Link="Internal\CommonGrpcProtocolHelpers.cs" />
<Compile Include="..\Shared\NonDisposableMemoryStream.cs" Link="Internal\NonDisposableMemoryStream.cs" />
<Compile Include="..\Shared\DefaultDeserializationContext.cs" Link="Internal\DefaultDeserializationContext.cs" />
<Compile Include="..\Shared\Server\BindMethodFinder.cs" Link="Model\Internal\Server\BindMethodFinder.cs" />
<Compile Include="..\Shared\Server\ClientStreamingServerMethodInvoker.cs" Link="Model\Internal\Server\ClientStreamingServerMethodInvoker.cs" />
<Compile Include="..\Shared\Server\DuplexStreamingServerMethodInvoker.cs" Link="Model\Internal\Server\DuplexStreamingServerMethodInvoker.cs" />
<Compile Include="..\Shared\Server\InterceptorPipelineBuilder.cs" Link="Model\Internal\Server\InterceptorPipelineBuilder.cs" />
<Compile Include="..\Shared\Server\MethodOptions.cs" Link="Model\Internal\Server\MethodOptions.cs" />
<Compile Include="..\Shared\Server\ServerMethodInvokerBase.cs" Link="Model\Internal\Server\ServerMethodInvokerBase.cs" />
<Compile Include="..\Shared\Server\ServerStreamingServerMethodInvoker.cs" Link="Model\Internal\Server\ServerStreamingServerMethodInvoker.cs" />
<Compile Include="..\Shared\Server\UnaryServerMethodInvoker.cs" Link="Model\Internal\Server\UnaryServerMethodInvoker.cs" />
<Compile Include="..\Shared\Server\ServerDynamicAccessConstants.cs" Link="Model\Internal\Server\ServerDynamicAccessConstants.cs" />
<Compile Include="..\Shared\Server\BindMethodFinder.cs" Link="Model\Internal\BindMethodFinder.cs" />
<Compile Include="..\Shared\Server\ClientStreamingServerMethodInvoker.cs" Link="Model\Internal\ClientStreamingServerMethodInvoker.cs" />
<Compile Include="..\Shared\Server\DuplexStreamingServerMethodInvoker.cs" Link="Model\Internal\DuplexStreamingServerMethodInvoker.cs" />
<Compile Include="..\Shared\Server\InterceptorPipelineBuilder.cs" Link="Model\Internal\InterceptorPipelineBuilder.cs" />
<Compile Include="..\Shared\Server\MethodOptions.cs" Link="Model\Internal\MethodOptions.cs" />
<Compile Include="..\Shared\Server\ServerMethodInvokerBase.cs" Link="Model\Internal\ServerMethodInvokerBase.cs" />
<Compile Include="..\Shared\Server\ServerStreamingServerMethodInvoker.cs" Link="Model\Internal\ServerStreamingServerMethodInvoker.cs" />
<Compile Include="..\Shared\Server\UnaryServerMethodInvoker.cs" Link="Model\Internal\UnaryServerMethodInvoker.cs" />
<Compile Include="..\Shared\NullableAttributes.cs" Link="Internal\NullableAttributes.cs" />
<Compile Include="..\Shared\CodeAnalysisAttributes.cs" Link="Internal\CodeAnalysisAttributes.cs" />
<Compile Include="..\Shared\NonCapturingTimer.cs" Link="Internal\NonCapturingTimer.cs" />
Expand Down
3 changes: 1 addition & 2 deletions src/Grpc.AspNetCore.Server/Internal/GrpcProtocolConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using Grpc.Shared.Server;
using Microsoft.AspNetCore.Http;
using Microsoft.Net.Http.Headers;

Expand Down Expand Up @@ -83,5 +82,5 @@ internal static int GetCancelErrorCode(string protocol)
return IsHttp3(protocol) ? Http3ResetStreamCancel : Http2ResetStreamCancel;
}

internal const DynamicallyAccessedMemberTypes ServiceAccessibility = ServerDynamicAccessConstants.ServiceAccessibility;
internal const DynamicallyAccessedMemberTypes ServiceAccessibility = DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods;
}
3 changes: 2 additions & 1 deletion src/Shared/Server/ClientStreamingServerMethodInvoker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

using System.Diagnostics.CodeAnalysis;
using Grpc.AspNetCore.Server;
using Grpc.AspNetCore.Server.Internal;
using Grpc.AspNetCore.Server.Model;
using Grpc.Core;
using Microsoft.AspNetCore.Http;
Expand All @@ -30,7 +31,7 @@ namespace Grpc.Shared.Server;
/// <typeparam name="TService">Service type for this method.</typeparam>
/// <typeparam name="TRequest">Request message type for this method.</typeparam>
/// <typeparam name="TResponse">Response message type for this method.</typeparam>
internal sealed class ClientStreamingServerMethodInvoker<[DynamicallyAccessedMembers(ServerDynamicAccessConstants.ServiceAccessibility)] TService, TRequest, TResponse> : ServerMethodInvokerBase<TService, TRequest, TResponse>
internal sealed class ClientStreamingServerMethodInvoker<[DynamicallyAccessedMembers(GrpcProtocolConstants.ServiceAccessibility)] TService, TRequest, TResponse> : ServerMethodInvokerBase<TService, TRequest, TResponse>
where TRequest : class
where TResponse : class
where TService : class
Expand Down
3 changes: 2 additions & 1 deletion src/Shared/Server/DuplexStreamingServerMethodInvoker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

using System.Diagnostics.CodeAnalysis;
using Grpc.AspNetCore.Server;
using Grpc.AspNetCore.Server.Internal;
using Grpc.AspNetCore.Server.Model;
using Grpc.Core;
using Microsoft.AspNetCore.Http;
Expand All @@ -30,7 +31,7 @@ namespace Grpc.Shared.Server;
/// <typeparam name="TService">Service type for this method.</typeparam>
/// <typeparam name="TRequest">Request message type for this method.</typeparam>
/// <typeparam name="TResponse">Response message type for this method.</typeparam>
internal sealed class DuplexStreamingServerMethodInvoker<[DynamicallyAccessedMembers(ServerDynamicAccessConstants.ServiceAccessibility)] TService, TRequest, TResponse> : ServerMethodInvokerBase<TService, TRequest, TResponse>
internal sealed class DuplexStreamingServerMethodInvoker<[DynamicallyAccessedMembers(GrpcProtocolConstants.ServiceAccessibility)] TService, TRequest, TResponse> : ServerMethodInvokerBase<TService, TRequest, TResponse>
where TRequest : class
where TResponse : class
where TService : class
Expand Down
26 changes: 0 additions & 26 deletions src/Shared/Server/ServerDynamicAccessConstants.cs

This file was deleted.

3 changes: 2 additions & 1 deletion src/Shared/Server/ServerMethodInvokerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

using System.Diagnostics.CodeAnalysis;
using Grpc.AspNetCore.Server;
using Grpc.AspNetCore.Server.Internal;
using Grpc.Core;
using Microsoft.AspNetCore.Http;

Expand All @@ -29,7 +30,7 @@ namespace Grpc.Shared.Server;
/// <typeparam name="TService">Service type for this method.</typeparam>
/// <typeparam name="TRequest">Request message type for this method.</typeparam>
/// <typeparam name="TResponse">Response message type for this method.</typeparam>
internal abstract class ServerMethodInvokerBase<[DynamicallyAccessedMembers(ServerDynamicAccessConstants.ServiceAccessibility)] TService, TRequest, TResponse>
internal abstract class ServerMethodInvokerBase<[DynamicallyAccessedMembers(GrpcProtocolConstants.ServiceAccessibility)] TService, TRequest, TResponse>
where TRequest : class
where TResponse : class
where TService : class
Expand Down
3 changes: 2 additions & 1 deletion src/Shared/Server/ServerStreamingServerMethodInvoker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

using System.Diagnostics.CodeAnalysis;
using Grpc.AspNetCore.Server;
using Grpc.AspNetCore.Server.Internal;
using Grpc.AspNetCore.Server.Model;
using Grpc.Core;
using Microsoft.AspNetCore.Http;
Expand All @@ -30,7 +31,7 @@ namespace Grpc.Shared.Server;
/// <typeparam name="TService">Service type for this method.</typeparam>
/// <typeparam name="TRequest">Request message type for this method.</typeparam>
/// <typeparam name="TResponse">Response message type for this method.</typeparam>
internal sealed class ServerStreamingServerMethodInvoker<[DynamicallyAccessedMembers(ServerDynamicAccessConstants.ServiceAccessibility)] TService, TRequest, TResponse> : ServerMethodInvokerBase<TService, TRequest, TResponse>
internal sealed class ServerStreamingServerMethodInvoker<[DynamicallyAccessedMembers(GrpcProtocolConstants.ServiceAccessibility)] TService, TRequest, TResponse> : ServerMethodInvokerBase<TService, TRequest, TResponse>
where TRequest : class
where TResponse : class
where TService : class
Expand Down
3 changes: 2 additions & 1 deletion src/Shared/Server/UnaryServerMethodInvoker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using System.Diagnostics.CodeAnalysis;
using System.Runtime.ExceptionServices;
using Grpc.AspNetCore.Server;
using Grpc.AspNetCore.Server.Internal;
using Grpc.AspNetCore.Server.Model;
using Grpc.Core;
using Microsoft.AspNetCore.Http;
Expand All @@ -31,7 +32,7 @@ namespace Grpc.Shared.Server;
/// <typeparam name="TService">Service type for this method.</typeparam>
/// <typeparam name="TRequest">Request message type for this method.</typeparam>
/// <typeparam name="TResponse">Response message type for this method.</typeparam>
internal sealed class UnaryServerMethodInvoker<[DynamicallyAccessedMembers(ServerDynamicAccessConstants.ServiceAccessibility)] TService, TRequest, TResponse> : ServerMethodInvokerBase<TService, TRequest, TResponse>
internal sealed class UnaryServerMethodInvoker<[DynamicallyAccessedMembers(GrpcProtocolConstants.ServiceAccessibility)] TService, TRequest, TResponse> : ServerMethodInvokerBase<TService, TRequest, TResponse>
where TRequest : class
where TResponse : class
where TService : class
Expand Down