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

Unable to perform this action because the process is running. #1027

Closed
Mecil9 opened this issue Dec 11, 2016 · 10 comments
Closed

Unable to perform this action because the process is running. #1027

Mecil9 opened this issue Dec 11, 2016 · 10 comments

Comments

@Mecil9
Copy link

Mecil9 commented Dec 11, 2016

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!

@gregg-miskelly
Copy link
Contributor

@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?

@Mecil9
Copy link
Author

Mecil9 commented Dec 12, 2016

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

@gregg-miskelly
Copy link
Contributor

gregg-miskelly commented Dec 12, 2016

@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.

@Mecil9
Copy link
Author

Mecil9 commented Dec 12, 2016

@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!

@gregg-miskelly
Copy link
Contributor

@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.

@Mecil9
Copy link
Author

Mecil9 commented Dec 12, 2016

@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

@ladaltamirano
Copy link

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

@rismarksvej
Copy link

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.

@gihwan-kim
Copy link

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?

@gregg-miskelly
Copy link
Contributor

@gihwan-kim See my reply above.

@dotnet dotnet locked as resolved and limited conversation to collaborators Dec 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants