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

Restart button no longer working (.dll's locked with "process cannot access the file" errors) #2596

Closed
winzig opened this issue Oct 10, 2018 · 2 comments

Comments

@winzig
Copy link

winzig commented Oct 10, 2018

In the last couple weeks I've started experiencing a problem with VS Code (Insiders) where the Restart button does not successfully restart the debugging process. Instead, I get this error over and over in the TERMINAL tab of vscode:

/usr/local/share/dotnet/sdk/2.1.105/Microsoft.Common.CurrentVersion.targets(4118,5): warning MSB3026: Could not copy "obj/Debug/netcoreapp2.0/Web.dll" to "bin/Debug/netcoreapp2.0/Web.dll". Beginning retry 1 in 1000ms. The process cannot access the file '/Users/tom/Documents/Repositories/code/Web/bin/Debug/netcoreapp2.0/Web.dll' because it is being used by another process. [/Users/tom/Documents/Repositories/code/Web/Web.csproj]

Environment data

dotnet --info output:

Toms-MacBook-Pro:diag.net tom$ dotnet --info
.NET Command Line Tools (2.1.105)

Product Information:
Version: 2.1.105
Commit SHA-1 hash: 141cc8d976

Runtime Environment:
OS Name: Mac OS X
OS Version: 10.13
OS Platform: Darwin
RID: osx.10.13-x64
Base Path: /usr/local/share/dotnet/sdk/2.1.105/

Microsoft .NET Core Shared Framework Host

Version : 2.0.7
Build : 2d61d0b043915bc948ebf98836fefe9ba942be11

VSCode Version: Version 1.29.0-insider (1.29.0-insider)
OS Version: macOS High Sierra 10.13.6 (17G65)
C# Extension version: 1.16.2

Steps to reproduce

  1. Hit the "Play" button to start debugging a .NET Core web project
  2. After a while, hit the Restart button to restart debugging
  3. See the above error over and over in the terminal tab
  4. Give up and hit the stop button, followed by the start button.

Expected behavior

Restart should restart debugging

Actual behavior

It doesn't.

@dombarnes
Copy link

I'm seeing this too. Intermittently the debugger isn't stopping the active process before running the new launch task. My launch action includes a task to run dotnet build on the project in question. Has been working up until the latest update (v1.28.0, extension version v1.16.2). In my specific example I am running two .Net Core sites.

Running on macOS Mojave 10.14. VSCode for Mac
launch.json

 {
            "name": "Portal",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build-portal",            
            "program": "${workspaceRoot}/Trilby.TrilbyTV.Web.Portal/bin/Debug/netcoreapp2.1/Trilby.TrilbyTV.Web.Portal.dll",
            "args": [],
            "cwd": "${workspaceRoot}/Trilby.TrilbyTV.Web.Portal",
            "stopAtEntry": false,
            "requireExactSource": false,
            "logging":
            {
                "moduleLoad": false
            },
            "env": {
                // "ASPNETCORE_preventHostingStartup": "true",
                // "ASPNETCORE_ENVIRONMENT": "Development"
                "ASPNETCORE_ENVIRONMENT": "Production"
            },
            "sourceFileMap": {
                "/Views": "${workspaceRoot}/Trilby.TrilbyTV.Web.Portal/Views"
            }
        }

dotnet --info

.NET Core SDK (reflecting any global.json):
 Version:   2.1.402
 Commit:    3599f217f4

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.14
 OS Platform: Darwin
 RID:         osx-x64
 Base Path:   /usr/local/share/dotnet/sdk/2.1.402/

Host (useful for support):
  Version: 2.1.4
  Commit:  85255dde3e

.NET Core SDKs installed:
  2.0.0 [/usr/local/share/dotnet/sdk]
  2.0.3 [/usr/local/share/dotnet/sdk]
  2.1.4 [/usr/local/share/dotnet/sdk]
  2.1.200 [/usr/local/share/dotnet/sdk]
  2.1.300 [/usr/local/share/dotnet/sdk]
  2.1.301 [/usr/local/share/dotnet/sdk]
  2.1.302 [/usr/local/share/dotnet/sdk]
  2.1.402 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

@gregg-miskelly
Copy link
Contributor

This is a duplicate of microsoft/vscode#60593

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants