0

I am trying to learn C# and have followed the instructions in this tutorial

I have created a project, added the controls to the design surface and added code to the button click event. When I get to the part which asks me to test the application, I click "start debugging" and I get an error message saying

There were build errors, would you like to continue and run the last successful build?

If I click no, nothing happens. If I click yes I get another error saying:

Visual Studio cannot start debugging because the debug target 'C:\Users\hp\source\repos\HelloWPFApp\HelloWPFApp\bin\Debug\HelloWPFApp.exe' is missing.

As a complete beginner I have no idea why this exe file is missing or how to fix it. Could someone point me in the right direction at all?

5
  • What happens if you choose Build > Build Solution first? Commented Dec 6, 2017 at 21:30
  • Have you tried to right-click on your solution and Rebuild it? Commented Dec 6, 2017 at 21:31
  • Possible duplicate of Debug Target Is Missing? Commented Dec 6, 2017 at 21:32
  • 1
    the obvious thing is that there are erros in your program. Can you see the build errors window (at the bottom of the screen)? Does it have anything? If you cant see it do View->Error List Commented Dec 6, 2017 at 21:38
  • I think you may have it. It seems there are errors in my code. Sorry if this was a stupid question. It's all very unfamiliar to me at the moment. I'll go away and try to fix the code. Thanks Commented Dec 6, 2017 at 21:41

3 Answers 3

1

It's possible that your code has never compiled. Press Ctrl-Shift-B and try again (or look in the Build menu).

Sign up to request clarification or add additional context in comments.

Comments

0

First: You should clean the project than Build project again.

Second: Run project by pressing F5

Executable file you can find in bin/Debug folder in your root of project.

1 Comment

Yes, this worked after I fixed the errors in the code that had stopped it from compiling. Was just a rookie mistake in the end
0

I do not have VS now, why don't you rebuild (or rebuild-all) your project, and if successfully rebuilds check whether the executable file exists in that folder, and also check the release folder, if it is there then change rebuild option to debug, as far as i remember you will see a drop down, on the toolbar,

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.