grpc-dotnet icon indicating copy to clipboard operation
grpc-dotnet copied to clipboard

Debug session crushes when using Docker

Open 7amou3 opened this issue 7 months ago • 1 comments

What version of gRPC and what language are you using? • gRPC for .NET (Grpc.AspNetCore) • Version: [please fill in] What operating system (Linux, Windows,...) and version? • Windows [please fill in version] What runtime / compiler are you using (e.g. .NET Core SDK version dotnet --info) • .NET 9 SDK • C# 13.0 • Docker Desktop • Visual Studio 2022

What did you do? When throwing an exception created by Google.Rpc.Status.ToRpcException(), the Visual Studio debugger crashes with the message: "the debugger adapter exited unexpectedly." Assigning the result of ToRpcException() to a variable does not crash the debugger, but actually throwing it does. Example code:

var rpcStatus = new Google.Rpc.Status
{
    Code = (int)Code.InvalidArgument,
    Message = "Bad request"
};
throw rpcStatus.ToRpcException(); // This line causes the debugger to crash

What did you expect to see? The exception should be thrown and caught by the debugger, allowing normal debugging of the error. What did you see instead? The Visual Studio debugger crashes with the message: "the debugger adapter exited unexpectedly" No additional stack trace or error message is provided. Anything else we should know about your project / environment? • All NuGet packages are up to date and compatible with .NET 9. • The issue only occurs when throwing the exception, not when constructing it. • This happens in a gRPC service handler.

7amou3 avatar May 21 '25 13:05 7amou3

This sounds like a bug in Visual Studio.

JamesNK avatar May 21 '25 23:05 JamesNK