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

IFrameworkHandle.LaunchProcessWithDebuggerAttached allows null for workingDirectory in signature but throws #5170

Open
bradwilson opened this issue Aug 10, 2024 · 0 comments

Comments

@bradwilson
Copy link

Description

According to the nullable annotations, IFrameworkHandle.LaunchProcessWithDebuggerAttached is allowed to pass a null for workingDirectory.

However, when I do so, I see my test process crash with the following stack trace:

StreamJsonRpc.RemoteInvocationException: Value cannot be null.
Parameter name: workingDirectory
   at StreamJsonRpc.JsonRpc.<InvokeCoreAsync>d__154`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.TestWindow.Logging.ILoggerExtensions.<CallWithCatchAsync>d__11`1.MoveNext()
RPC server exception:
System.ArgumentNullException: Value cannot be null.
Parameter name: workingDirectory
      at Microsoft.VisualStudio.TestWindow.Extensibility.ValidateArg.NotNull[T](T arg, String parameterName)
      at Microsoft.VisualStudio.TestWindow.Extensibility.ValidateArg.NotNullOrEmpty[T](IEnumerable`1 arg, String parameterName)
      at Microsoft.VisualStudio.TestWindow.Core.Debugging.DebugLauncher.<LaunchProcessUnderDebuggerInternalAsync>d__7.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Microsoft.VisualStudio.TestWindow.Core.Debugging.DebugLauncher.<LaunchProcessUnderDebuggerAsync>d__5.MoveNext()
   --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
      at Microsoft.VisualStudio.TestWindow.Client.TestWindowServiceCallback.<LaunchDebugTestHostAsync>d__14.MoveNext()

The active test run was aborted. Reason: Exception of type 'Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException' was thrown.

Steps to reproduce

Call IFrameworkHandle.LaunchProcessWithDebuggerAttached with a null value for workingDirectory.

Expected behavior

Process is launched into the debugger with the current working directory.

Actual behavior

Exception is thrown and the test process crashes.

Diagnostic logs

There are no instructions on collecting diagnostic logs when using Test Explorer, and this can only be reproduced in Test Explorer.

Environment

Windows 11 23H2 (22631.3880)
Visual Studio 2022 17.10.4
.NET SDK 8.0.303

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

No branches or pull requests

1 participant