Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't run Visual Studio 2022 debugger on React app (.esproj) without `.vscode/launch.json` file? Why?

I've been searching high and low for an explanation on this, or a workaround, and there's nothing out there. I've googled, I've tried ChatGPT-4 for an explanation, and nothing. Can anyone explain to me why a javascript project in Visual Studio 2022 (not VS code to be clear!), a .esproj file, needs the folder .vscode with a launch.json file in it to launch the debugger properly in VS2022.

I have been told that including your .vs and/or .vscode folder isn't needed when commiting my code to github or some kind of code base, but when I left out the .vscode/launch.json and then clone my repository, the project doesn't run as expected when I do a multiple launch (because it's a full stack app with an ASP.NET backend). If the .vscode/launch.json is missing, it just breaks the whole thing.

I can't find any kind of explanation in any documentation, so any links would be appreciated, or any kinds of suggestions for best practices.

EDIT:

Ok so there is a single note here:

Note

launch.json stores the startup settings associated with the Start button in the Debug toolbar. Currently, launch.json must be located under the .vscode folder.

But it doesn't really explain why VS 2022 needs VScode folder structure/files. Anyone know this?

Thank you.

like image 317
glitchwizard Avatar asked Sep 16 '25 05:09

glitchwizard


1 Answers

As you can get from the "Set the project properties part"

This configuration is needed in Visual Studio.

But this does not mean that the project created by Visual Studio itself has any dependencies on VSCode, it is just where the configuration file is located, nothing more.

The original intention of this design is just to allow projects that was able to be debugged in VSCode to be debugged directly in Visual Studio without cumbersome configuration migration.

In VSCode, it is just a configuration file path too:

https://code.visualstudio.com/docs/nodejs/reactjs-tutorial#_configure-the-debugger

We can't think that it is unique to VSCode as soon as we see that the folder is called .vscode, or that the created project must be based on VSCode because the folder is .vscode. This is just a configuration file path.

like image 196
Bowman Zhu Avatar answered Sep 18 '25 21:09

Bowman Zhu