2

When I create a new C# Windows Form Application in Visual Studio 2010, I cannot run the application due to the following error:

"Visual Studio cannot start debugging because the debug target 'C:\Users\blankdud\Documents\Visual Studio 2010\Projects\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe' is missing. Please build the project and retry, or set the OutputPath and AssemblyName propertiesappropriately to point at the correct location for the target assembly."

I've done some Google searches about the exact problem and most of the results did not involve a new project like my issue here. I tried to just build the application as it suggests, and I get "Build: 0 succeeded or up-to-date, 1 failed, 0 skipped". I looked up the Output path in the Build tab of the project's properties and it is set to bin\Debug. In the Application tab, the assembly name matches the project, "WindowsFormsApplication1".

Looking inside of the bin\Debug\ folder itself I have WindowsFormsApplication1.vshost.exe and WindowsFormsApplication1.vshost.exe.manifest, which also looks fine to me. The configuration in the properties of the solution also seems to be correct, listing my project, configuration and platform properly and the Build checkbox is ticked.

I'm a bit lost at this point as to what I should try next. I'm not sure what I am overlooking at this point and any help would be greatly appreciated. I also wanted to mention that making a C# Console Application works completely fine.


TL;DR
Brand new C# and C++ winforms will not build. No errors exist in the error list. Configuration properties seem to be correct.

UPDATE1
Looking over some past projects that are also WinForms, I notice that when I try and run them I get an error saying there was build errors. If I run the last successful build then everything works fine, otherwise there are no errors listed at all.

UPDATE2
I've been scouring the net for any help with this to no avail so far. It seems no matter what I try and do, building the project fails and an exe is never created in the bin\Debug folder. I also have tried resetting VS's environment settings back to defaults. As far as I am aware, this was all working up until I installed ASP.NET MVC4. I have no reason to suspect this was the cause.

Blankdud
  • 698
  • 5
  • 9
  • 22
  • 1
    Have you any other error that prevent build you application? –  Apr 03 '14 at 11:30
  • 1
    Delete the whole debug folder, then right click the solution and select "Rebuild" see if that works. If it doesn't well i remember back in 2003 there was Visual Studio for student and you could not create exe files with it if it's still like that today make sure you don't have such version – Franck Apr 03 '14 at 11:31
  • Your project have compilation errors. Check your errors tab, correct them, build it again. – Florian F. Apr 03 '14 at 11:31
  • Also please check your release folder if you set release mode for your prject –  Apr 03 '14 at 11:31
  • Does this happen for any other win form apps? – MattR Apr 03 '14 at 11:34
  • There are no other errors listed aside from the error in my summary above. I have tried deleting the debug folder and rebuilding, but had no luck. Changing the project mode to release just creates the release folder but with the same issue. I have made tons of WinForm apps before this with no problems as recent as last week. This seems to occur with any new WinForms that are created. – Blankdud Apr 03 '14 at 12:08
  • if that's only happening on winforms try deleting the default form, remove code in `program.cs` that call it. then remove the `system.windows.forms` reference in the project and try again. could be recent windows update that affected your framework, i doubt but worth the shot. – Franck Apr 04 '14 at 11:43

6 Answers6

3

Your project wont build because you have compile errors.

Fix your errors and then build your project

Jonny
  • 401
  • 2
  • 11
  • There are 0 errors listed in the error list. No code has been added or removed from the project after it was created. – Blankdud Apr 03 '14 at 12:02
  • If you dont have any errors and it wont compile :\Users\blankdud\Documents\Visual Studio 2010\Projects\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe' is missing. Please build the project and retry, or set the OutputPath and AssemblyName propertiesappropriately to point at the correct location for the target assembly." in the solution properties page, check whether the path you are expecting the exe to be is same as the one specified in Linker -> Output file. http://stackoverflow.com/questions/3231463/visual-studio-compiles-but-the-exe-isnt-there – Jonny Apr 03 '14 at 12:08
1

I think you have compile errors.Check your error window.

Have you any other error that prevent build you application?

If you don't have any error You can delete your bin in your solution's folder and then rebuild your project.

  • There are 0 errors listed in the error list. No code has been added or removed from the project after it was created. No other errors aside from the one I had noted are visible. If I delete the bin folder and try and rebuild the solution, my Output shows: Rebuild All: 0 succeeded, 1 failed, 0 skipped The same error still occurs. – Blankdud Apr 03 '14 at 12:03
0

Sadly, after tons of reading similar issues I was never able to find a solution for this issue. I am not even really sure what caused the issue in the first place, but it was only truly resolved after I re-OSed my system and reinstalled VS.

Blankdud
  • 698
  • 5
  • 9
  • 22
0

You can rename the .exe file in the bin folder of the project to the new project name.

mehdi
  • 1
0

I had this problem when I upgraded a project to Visual Studio 2015 from an earlier version.

The problem was that the settings for the build configuration manager had not ported across properly.

I looked in Build → Configuration Manager and the Build checkbox for my project was unchecked. I checked it and the program now starts OK.

gvlasov
  • 18,638
  • 21
  • 74
  • 110
Paul D
  • 601
  • 7
  • 13
0

I was creating a new project and received this error .After much trial and test with all possible solutions like changing configurations in properties I fixed it by removing the errors noted in AssemblyInfo.cs (Your>Project>properties>AssemblyInfo,cs)

Open this in IDE and remove spaces created in [assembly: AssemblyConfiguration(" ")] and [assembly: AssemblyCopyright("Copyright © 2016")] to be on same line .For some reason it build on different lines so by removing the spaces it removes the errors. And then it's fixed.

Tim
  • 4,217
  • 1
  • 15
  • 21