Omnisharp-vscode: Unable to perform this action because the process is running.

Created on 11 Dec 2016  路  10Comments  路  Source: OmniSharp/omnisharp-vscode

Environment data

dotnet --info output: 1.0.0-preview2-1-003177
VS Code version:1.7.2
OS: OSX 10.12.1
C# Extension version: 1.5.3
mono version :4.8.0

When i debug C# program , is throw a Error:

Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.1.0/System.IO.FileSystem.Primitives.dll'. Cannot find or open the symbol file.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.1.0/System.Runtime.Handles.dll'. Cannot find or open the symbol file.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.1.0/System.Text.Encoding.dll'. Cannot find or open the symbol file.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.1.0/System.Text.Encoding.Extensions.dll'. Cannot find or open the symbol file.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.1.0/System.Threading.Tasks.dll'. Cannot find or open the symbol file.

Unable to perform this action because the process is running.

stop debug, then throw another error:
The program '/Users/Mecil9/Homework/hwapp/bin/Debug/netcoreapp1.1/hwapp.dll' has exited with code 0 (0x00000000).

my launch.json file:
`` {
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/bin/Debug/netcoreapp1.1/hwapp.dll",
"args": [],
"cwd": "${workspaceRoot}",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/bin/Debug/netcoreapp1.1/hwapp.dll",
"args": [],
"cwd": "${workspaceRoot}",
"stopAtEntry": false,
"launchBrowser": {
"enabled": true,
"args": "${auto-detect-url}",
"windows": {
"command": "cmd.exe",
"args": "/C start ${auto-detect-url}"
},
"osx": {
"command": "open"
},
"linux": {
"command": "xdg-open"
}
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceRoot}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command.pickProcess}"
}
]
}
````

go to Visual studio and Terminal is OK!

Debugger Question

Most helpful comment

@Mecil9 Thanks! Now I understand your question - the debug console isn't a terminal to your application. So when you enter something from the keyboard you aren't sending input to your application, instead you are asking the debugger to evaluate the expression, so the debugger will tell you 'I can't evaluate something right now because the debugger isn't stopped'. If you want to make an application that reads from the console then you want to change your lanch.json so that externalConsole is set to true.

All 10 comments

@Mecil9 I think the message Unable to perform this action because the process is running is coming from your program rather than the debugger itself. What kind of app are you trying to debug (ex: console app, web app)? Near the call stack window do you see PAUSED ON EXCEPTION? If you are debugging a web app, do you have another copy running?

@gregg-miskelly thanks, i am running the program in VScode's c# debugger. i haven't another copy running.

@Mecil9 You didn't say what kind of application you are debugging. Something like a console app - you can run as many instances as you like. A web app on the other hand you can only run multiple instances if you change the port number for each instance. I am assuming you are debugging a web app?

BTW: The program '/Users/Mecil9/Homework/hwapp/bin/Debug/netcoreapp1.1/hwapp.dll' has exited with code 0 (0x00000000). isn't an error - that just means your process was successfully shutdown.

@gregg-miskelly console app. i am learning C#, when i wanna to run the .Net tutorials programs on the VScode. code like this:

using System;

class Program
{
    static void Main()
    {
        int numberToGuess = new Random().Next(1,101);
        int currentGuess = 0;
        while (currentGuess != numberToGuess)
        {
            Console.WriteLine("Guess the number (1 to 100 )");
            currentGuess = int.Parse(Console.ReadLine());
            if(currentGuess < numberToGuess )
            {
                Console.WriteLine("You guessed too low! try again!");
            }
            if(currentGuess > numberToGuess)
            {
                Console.WriteLine("You guessed too high! try again!");
            }
        }
        Console.WriteLine("You got it! Good job!");
    }
}

debug this code,

Guess the number (1 to 100 )
10
Unable to perform this action because the process is running.

so I was confused.

if i run another code,don't need to input keyboard, it is ok!
as the same code running on VS(not vscode),it's ok!

@Mecil9 Thanks! Now I understand your question - the debug console isn't a terminal to your application. So when you enter something from the keyboard you aren't sending input to your application, instead you are asking the debugger to evaluate the expression, so the debugger will tell you 'I can't evaluate something right now because the debugger isn't stopped'. If you want to make an application that reads from the console then you want to change your lanch.json so that externalConsole is set to true.

@gregg-miskelly Thank you for your patience answer, problem solved!VScode debugging is not familiar to me, just from JavaScript turn around, ready to do hololense development. It seems that this problem can be closed. : P

This does not work for C++ clang on Ubuntu.
Any other alternative?

I'm subject to this issue. The Debug console is not able to use for ISO C program debugging. Whatever I type, the console is "Unable to perform this action because the process is running". It is the same with external console set to true.

I'm subject to this issue. The Debug console is not able to use for ISO C program debugging. Whatever I type, the console is "Unable to perform this action because the process is running". It is the same with external console set to true.

i have same issue. did you solved this problem?

@gihwan-kim See my reply above.

Was this page helpful?
0 / 5 - 0 ratings