dotnet / dotnet/vscode-csharp

Run debug session as sudo

Open
#1,811 10 comments 3 reactions 0 assignees View on GitHub
Debugger Feature Request
Dominant language
TypeScript
Stars
3.1k
Forks
737
Avg merge
17h 56m
Merged PRs (30d)
21

Description

## Environment data
`dotnet --info` output:
.NET Command Line Tools (2.0.0)

Product Information:
Version: 2.0.0
Commit SHA-1 hash: cdcd1928c9

Runtime Environment:
OS Name: ubuntu
OS Version: 16.04
OS Platform: Linux
RID: ubuntu.16.04-x64
Base Path: /usr/share/dotnet/sdk/2.0.0/

Microsoft .NET Core Shared Framework Host

Version : 2.0.0
Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d

VS Code version:
1.17.2
b813d12980308015bcd2b3a2f6efa5c810c33ba5

C# Extension version:
1.12.1

## Steps to reproduce
1. Create a console project.
2. Execute bash command in code that requires sudo permission

## Expected behavior
command to be executed with root privilege.

## Actual behavior
permission denied error

I have looked in launch settings documentation and also intellisense but I cannot see anywhere to set my debug launch options to use sudo. The work around is to launch VS Code as root but I have seen other languages vs code debuggers like python have ability to set it as a launch parameter for debugging session.

Is there any way to do this?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.