First off, I'm not sure if this is the correct spot for this problem, but I am on windows. I am trying to compile c# code on windows 7 using visual studio code. I have all the extensions downloaded but am getting this error:

launch: program 'launch: launch.json must be configured. Change 'program' to the path to the executable file that you would like to debug.

I can not figure out how to fix it. This is the line which I believe needs to be changed in the launch.json file, this is what is currently there:

"program": "${workspaceRoot}/bin/Debug/<target-framework>/<exam1.dll>",

(exam1 because that is the name of my .cs file containing my csharp code).

Any help is greatly appreciated!

  • borderline on-topic here. Maybe you'll get better answer at stackoverflow.com, that is the site for programming questions. – Máté Juhász Nov 24 '16 at 7:25

Assuming exam1 is the name of the directory where your project is (that's what decides the name of the executable, not the name of the C# file), and that you didn't modify your project.json (so it's targeting .Net Core 1.0), then the line should be:

"program": "${workspaceRoot}/bin/Debug/netcoreapp1.0/exam1.dll",

If this does not work for you, you can find out what is the right path by building your project (dotnet build on the command line or running the build task from the F1 menu) and then looking into the bin/Debug subdirectory.

  • when I go into the folder where my .cs file is, this is the whole path: "C:\Users\Kdrumz\Desktop\ObjectOriented\exam 1.cs". I am so confused, I tried clicking f1, but it brought up the same launch.json error. Any ideas? – Kdrumz Nov 24 '16 at 18:34

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.