0

When I am trying to run a program in Visual Studio, I do not have the option to debug the program. I only have the option to "Attach". I have looked up other solutions to this problem but I do not have anything to solve the problem. I will be attaching an image to this post. Thank you in advance for your time.

enter image description here

  • Microsoft Visual Studio Community 2017
    • Version 15.9.5
  • Microsoft .NET Framework
    • Version 4.7.03056
Ramhound
  • 42,708
  • Do you have your build configuration in Release or Debug? Edit your question to provide the necessary information required to answer your question. – Ramhound Jan 16 '19 at 01:31
  • Why did you copy and paste and provide every Visual Studio extension you have installed? You failed to indicate if you have your project in Debug or Release configuration. – Ramhound Jan 16 '19 at 01:50
  • Where do I find that? – Letholor Jan 16 '19 at 01:53
  • Did you open a project or a single file? Is this your program or someone elses? How much experience do you have with Visual Studio and C++? – HazardousGlitch Jan 16 '19 at 02:02
  • I opened a file. I have a little experience but not much. I opened a file for my class that I'm in. – Letholor Jan 16 '19 at 02:04
  • @Letholor - You need to add your source file to a project solution. The project configuration (Release, Debug) would be next to the words the "run icon" within Visual Studio. – Ramhound Jan 16 '19 at 02:24

1 Answers1

1

You can't debug a single file, you'll need to open a Solution(.sln) or Project (.vcxproj) instead. The Solution/Project contains all the configuration, settings and files needed for the program. Inside the folder you got from school should be a .sln or .vcxproj file (or both). Solutions can hold multiple Projects. Projects are the individual programs you're writing. Open that and try debugging again.

  • 1
    It seems that I need to notify my professor that I was not given the solution file. That explains why I couldn't find it while trying to open it from Visual Studio. – Letholor Jan 16 '19 at 03:55