microsoft / vscode-dotnettools

This is a feedback repository to capture issues logged for the C# Dev Kit and related extensions from Visual Studio Code
Other
228 stars 12 forks source link

[BUG] debugger unit test project error in ubuntu 24.04:vsdbg must be running with root permissions. #1433

Open mypursuit opened 1 month ago

mypursuit commented 1 month ago

Describe the Issue

I create an nunit test project use vscode in ubuntu 24.04 ; it's work will when I run ,but work error when I debug it

nunit test code :

public class TestX
{
    [Test]
    public void TestString()
    {

    }

}

image

------------------------------------------------------------------------------
You may only use the Microsoft Visual Studio .NET/C/C++ Debugger (vsdbg) with
Visual Studio Code, Visual Studio or Visual Studio for Mac software to help you
develop and test your applications.
------------------------------------------------------------------------------
Unable to start debugging. Failed to attach to process: The .NET Debugger (vsdbg) has insufficient privileges to debug this process. To debug this process, vsdbg must be running with root permissions.

Steps To Reproduce

No response

Expected Behavior

No response

Environment Information

Version: 1.92.2 Commit: fee1edb8d6d72a0ddff41e5f71a671c23ed924b9 Date: 2024-08-14T17:29:30.058Z Browser: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Code/1.92.2 Chrome/124.0.6367.243 Electron/30.1.2 Safari/537.36

ocallesp commented 1 month ago

@mypursuit are you running vscode in the root folder ? like sudo code .

It seems that the process you are trying to attach to is different than what the vs code (the debugger) can use.

Could try to use sudoto see if that helps resolve the issue ?

mypursuit commented 1 month ago

not root folder,not run use sudo debug console project is ok the error throw just debug method in unit test project,and run unit test method is ok too

---- Replied Message ---- | From | Osvaldo @.> | | Date | 09/11/2024 07:04 | | To | @.> | | Cc | @.>@.> | | Subject | Re: [microsoft/vscode-dotnettools] [BUG] debugger unit test project error in ubuntu 24.04:vsdbg must be running with root permissions. (Issue #1433) |

@mypursuit are you running vscode in the root folder ? like sudo code .

It seems that the process you are trying to attach to is different than what the vs code (the debugger) can use.

Could try to use 'sudo' to see if that helps resolve the issue ?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

ocallesp commented 1 month ago

@mypursuit just to confirm: You mentioned that you are not running VSCode from the root folder and not using sudo. The console project debugs without any issues, but the error occurs only when you try to debug methods in your unit test project. Running the unit test methods without debugging works fine. Is this correct ? Also, I noticed you didn't respond to my previous question: Could you try using sudoto see if that helps resolve the issue?

mypursuit commented 1 month ago

Yes,you are right! 1.My project not in root folder,just debug method in unit test project throw error 2.have try to use sudo to run code ,also the same error. Even I added code and vsdbg to "/etc/sudoers" to execute sudo configuration, and use sudo to run code ,also error

I do not how to resolve this error,but my work must be continue ,now I have use vscode in windows,it is work well.

At 2024-09-11 08:41:18, "Osvaldo Calles" @.***> wrote:

@mypursuit just to confirm: You mentioned that you are not running VSCode from the root folder and not using sudo. The console project debugs without any issues, but the error occurs only when you try to debug methods in your unit test project. Running the unit test methods without debugging works fine. Is this correct ? Also, I noticed you didn't respond to my previous question: Could you try using sudo to see if that helps resolve the issue?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

ocallesp commented 1 month ago

@mypursuit Just to confirm, is the issue occurring on Linux when the project is not in the root folder? It seems that everything works well on Windows under the same conditions.

mypursuit commented 1 month ago

Yes.Ubuntu 24.04

---- Replied Message ---- | From | Osvaldo @.> | | Date | 09/11/2024 23:24 | | To | @.> | | Cc | @.>@.> | | Subject | Re: [microsoft/vscode-dotnettools] [BUG] debugger unit test project error in ubuntu 24.04:vsdbg must be running with root permissions. (Issue #1433) |

@mypursuit Just to confirm, is the issue occurring on Linux? It seems to work correctly on Windows.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

ocallesp commented 1 month ago

Any thoughts on this issue ? @WardenGnaw