title: Cannot Run or Debug C# tests with CodeLens in VSCode
body: <p>I am trying to run my xUnit tests within VSCode using the Run CodeLens
  <a href="https://i.stack.imgur.com/1s8uT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1s8uT.png" alt="A Picture of the CodeLens" /></a>.</p>
  <p>I am using VSCode 1.65.0 with .Net 6 (6.0.200) on a 2019 MacBook Pro (Intel) with the v1.24.1 of the C# VSCode extension.</p>
  <p>I have run it using the <code>dotnet test</code> command, the .NET Core Test Explore Plugin and VS2022, and these work as expected.</p>
  <p>This is the output log I get</p>
  <pre><code>----- Running test method &quot;net6TestTest.TestControllerTest.Get_ShouldReturn_String&quot; -----
  
  Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET
  Copyright (C) Microsoft Corporation. All rights reserved.
  
  /usr/local/share/dotnet/sdk/6.0.200/Microsoft.Common.CurrentVersion.targets(4650,5): error MSB3883: Unexpected exception:  [/Users/ssmale/Projects/net6Test/net6Test/net6Test.csproj]
  /usr/local/share/dotnet/sdk/6.0.200/Microsoft.Common.CurrentVersion.targets(4650,5): error : DirectoryNotFoundException: Could not find a part of the path '/Users/ssmale/Projects/net6Test/net6Test/bin/Debug/net6.0/ref/net6Test.dll'. [/Users/ssmale/Projects/net6Test/net6Test/net6Test.csproj]
  /usr/local/share/dotnet/sdk/6.0.200/Microsoft.Common.CurrentVersion.targets(4650,5): error :    at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) [/Users/ssmale/Projects/net6Test/net6Test/net6Test.csproj]
  /usr/local/share/dotnet/sdk/6.0.200/Microsoft.Common.CurrentVersion.targets(4650,5): error :    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) [/Users/ssmale/Projects/net6Test/net6Test/net6Test.csproj]
  /usr/local/share/dotnet/sdk/6.0.200/Microsoft.Common.CurrentVersion.targets(4650,5): error :    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize) [/Users/ssmale/Projects/net6Test/net6Test/net6Test.csproj]
  /usr/local/share/dotnet/sdk/6.0.200/Microsoft.Common.CurrentVersion.targets(4650,5): error :    at System.IO.FileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite) [/Users/ssmale/Projects/net6Test/net6Test/net6Test.csproj]
  /usr/local/share/dotnet/sdk/6.0.200/Microsoft.Common.CurrentVersion.targets(4650,5): error :    at System.IO.File.Copy(String sourceFileName, String destFileName, Boolean overwrite) [/Users/ssmale/Projects/net6Test/net6Test/net6Test.csproj]
  /usr/local/share/dotnet/sdk/6.0.200/Microsoft.Common.CurrentVersion.targets(4650,5): error :    at Microsoft.CodeAnalysis.BuildTasks.CopyRefAssembly.Copy() [/Users/ssmale/Projects/net6Test/net6Test/net6Test.csproj]
  /usr/local/share/dotnet/sdk/6.0.200/Microsoft.Common.CurrentVersion.targets(4650,5): error :  [/Users/ssmale/Projects/net6Test/net6Test/net6Test.csproj]
  
  Build FAILED.
  
  /usr/local/share/dotnet/sdk/6.0.200/Microsoft.Common.CurrentVersion.targets(4650,5): error MSB3883: Unexpected exception:  [/Users/ssmale/Projects/net6Test/net6Test/net6Test.csproj]
  /usr/local/share/dotnet/sdk/6.0.200/Microsoft.Common.CurrentVersion.targets(4650,5): error : DirectoryNotFoundException: Could not find a part of the path '/Users/ssmale/Projects/net6Test/net6Test/bin/Debug/net6.0/ref/net6Test.dll'. [/Users/ssmale/Projects/net6Test/net6Test/net6Test.csproj]
  /usr/local/share/dotnet/sdk/6.0.200/Microsoft.Common.CurrentVersion.targets(4650,5): error :    at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) [/Users/ssmale/Projects/net6Test/net6Test/net6Test.csproj]
  /usr/local/share/dotnet/sdk/6.0.200/Microsoft.Common.CurrentVersion.targets(4650,5): error :    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) [/Users/ssmale/Projects/net6Test/net6Test/net6Test.csproj]
  /usr/local/share/dotnet/sdk/6.0.200/Microsoft.Common.CurrentVersion.targets(4650,5): error :    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize) [/Users/ssmale/Projects/net6Test/net6Test/net6Test.csproj]
  /usr/local/share/dotnet/sdk/6.0.200/Microsoft.Common.CurrentVersion.targets(4650,5): error :    at System.IO.FileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite) [/Users/ssmale/Projects/net6Test/net6Test/net6Test.csproj]
  /usr/local/share/dotnet/sdk/6.0.200/Microsoft.Common.CurrentVersion.targets(4650,5): error :    at System.IO.File.Copy(String sourceFileName, String destFileName, Boolean overwrite) [/Users/ssmale/Projects/net6Test/net6Test/net6Test.csproj]
  /usr/local/share/dotnet/sdk/6.0.200/Microsoft.Common.CurrentVersion.targets(4650,5): error :    at Microsoft.CodeAnalysis.BuildTasks.CopyRefAssembly.Copy() [/Users/ssmale/Projects/net6Test/net6Test/net6Test.csproj]
  /usr/local/share/dotnet/sdk/6.0.200/Microsoft.Common.CurrentVersion.targets(4650,5): error :  [/Users/ssmale/Projects/net6Test/net6Test/net6Test.csproj]
      0 Warning(s)
      2 Error(s)
  
  Time Elapsed 00:00:01.26
  
  
  </code></pre>