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

Debugger: Improve the error message when vscode attempt to attach to dotnet process with mismatched privilege #477

Closed
richardzeng1985 opened this issue Jun 28, 2016 · 13 comments
Assignees
Milestone

Comments

@richardzeng1985
Copy link

richardzeng1985 commented Jun 28, 2016

Environment data

dotnet --info output:
VS Code version:1.2.1
C# Extension version:1.1.7

Steps to reproduce

  1. Create a sample .dotnet core console application with following code:

    public static void Main(string[] args)
    {
        Console.ReadLine();
        Console.WriteLine("Hello World!");
    }
    
  2. Launch vscode with non-admin and open the project

  3. Launch command line with admin, and run the application "dotnet run"

  4. Set the target as "attach" and configure the process id of "dotnet"

  5. F5

    Expected behavior

Actually, when I did the testing, I was not aware of launching vscode with non-admin, I suppose this is not supported scenario, however I assume we should at least improve the error message,

  1. At least we should try to remove the internal error message "Unexpected CLRDBG output from command "-target-attach 8508". " ?
  2. Is it possible to add some useful information similar like "vscode doesn't have the sufficient permission to attach the process" if the permission of vscode and attached process is mismatched ?

Actual behavior

Error: No process with the specified id is currently running.

(This is VSDBGE_E_PROCESS_ID_NOT_FOUND)

@richardzeng1985 richardzeng1985 changed the title Debugger: Error when attemp to attach to dotnet process Debugger: Error when attempt to attach to dotnet process Jun 28, 2016
@richardzeng1985 richardzeng1985 changed the title Debugger: Error when attempt to attach to dotnet process Debugger: Improve the error message when vscode attempt to attach to dotnet process with mismatched privilege Jun 28, 2016
@rajkumar42
Copy link
Contributor

Thanks for reporting. I'm looking into it.

@WardenGnaw
Copy link
Contributor

image

Internal error message now includes "Access is denied." Should there be another message instead?

@gregg-miskelly @caslan

@gregg-miskelly
Copy link
Contributor

That error message looks reasonable to me. The only thing we might want to do is detect that admin privileges are needed and launch vsdbg as an admin process. But we could also just wait for someone to ask for the feature.

@kroppt
Copy link

kroppt commented Jul 20, 2017

@gregg-miskelly

This is an issue for me. Is there a way to elevate this process manually? I am kind of a noob when it comes to vscode. What @gregg-miskelly said would be useful.

If you need the manpower, I may be willing to try helping.

@gregg-miskelly
Copy link
Contributor

@kroppt What OS are you on?

@kroppt
Copy link

kroppt commented Jul 20, 2017

@gregg-miskelly
Windows Server 2008 R2 Standard
Service Pack 1
Microsoft's VS Code build

@gregg-miskelly
Copy link
Contributor

@kroppt If you close VS Code, right click on it from the start menu/task bar, and choose 'Run as administrator' the debugger should run elevated and therefore be able to attach to the process.

@kroppt
Copy link

kroppt commented Jul 20, 2017

This did not work for me. It is worth noting that dotnet is running under NETWORKSERVICE, which has access to some SQL Active Directory stuff. Administrator should be able to operate on such a process I believe.

I am also kind of a noob when it comes to Windows user permissions.

@gregg-miskelly
Copy link
Contributor

@kroppt Yes, I would expect that to work. Can you give me the full error message to see if that gives me any more hints as to what could be going on?

@kroppt
Copy link

kroppt commented Jul 21, 2017

image

Access is denied.

@gregg-miskelly
Copy link
Contributor

@kroppt I reproduced your issue and I opened up #1660 to track it. I hope to have a private out later today with the fix.

@gregg-miskelly
Copy link
Contributor

On Linux/OSX I think we should consider auto-elevating in this scenario. This is related to #1811

@gregg-miskelly gregg-miskelly added this to the 1.16 milestone May 8, 2018
@gregg-miskelly
Copy link
Contributor

Lets see if we can fix this for 1.16, as several people have hit into it now.

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

5 participants