Why does VS claim that my project is of DLL type when it is set as an EXE type? - visual-studio

I am trying to launch the Console.Tests part of https://github.com/ServiceStack/ServiceStack.Redis in Debug mode (by pressing F5), so that I can place a breakpoint in it.
Visual Studio (2013), however, refuses to do so, claiming that my project is of DLL type:
Why? What am I missing?
BTW, building this project produces Console.Tests.exe in Visual Studio 2013\Projects\ServiceStack.Redis-master\tests\Console.Tests\bin\Debug which runs just fine.
Also, if I attempt to debug the project by right-clicking its menu, it also starts just fine:
Why? What am I missing?

You need to tell Visual Studio which StartUp project it should run by right clicking on Console.Tests project in solution explorer and selecting Set as Startup Project.

Related

Assign executable file name for debug session (Visual Studio 2019)

We have a legacy Visual Studio 2003.NET C++ DLL project. Still works with VS2003 on Windows 10 but we're looking to migrate to VS2019.
In VS2003 when you debug (F5), the box Executable for Debugging Session pops up. In the Executable file name box you select Browse... and navigate to the .EXE which will consume your DLL. Great!
But how to do the same in VS2019? Whenever I debug, Visual Studio thinks I'm using the Local Windows Debugger and I get the error "[PATH][PROJECT].dll is not a valid Win32 application". The Debug > Attach to Process... option is not right either because my target executable is not running yet.
If I'm understanding the problem correctly, I think you want to select the Debugging section of your DLL project's property pages. There you can choose which debugger to use and you can even set the executable you want to launch.

Unable to debug issue Apache cordova project in vs 2017

I have install visual studio 2017 with almost all components on my PC (windows 8.1) but when I Add new Apache Cordova project and run it will show
"unable to start debugging. The startup project cannot be launched. Ensure that the correct project is set as the startup project. The startup project can be changed by selecting 'Set as startup project' command from right click menu solution explorer. Additionally make sure its debug settings are correctly configured in the project properties" Other project types are work fine. Project Properties
I have already set startup project but it is not working please help
In case someone is struggling with the same, here's the step to fix it. Go to Visual Studio "Tools" > "Extension and Updates" > then search for "Cordova". Make sure it is turned on:
I just lost a couple of hours to this error. For me, the solution was to follow the instructions available at this link:
In case that link ever dies, here is a copy of the instructions:
If you get a message in Visual Studio that says you can't start debugging your app, try these steps. Also, try these steps if no emulators or devices are listed in the debug target dropdown list.
Close all instances of Visual Studio.
Open this folder:
C:\Users\username%appdata%\Local\Microsoft\Phone Tools
Rename the CoreCon folder to any other name (CoreCon will get recreated when you rebuild).
Restart Visual Studio and try again.

Unable to run multiple startup projects in Visual Studio 2015

I'm using VS 2015 Enterprise Update 1, although this happened before update 1 as well.
At some point, I became unable to do CTRL+F5 (Start without Debugging) when my solution is configured with multiple startup projects. It doesn't matter what these projects are - in fact, I can have a single project selected in the multi-project dialog, and I get the same error.
The error is:
Unable to start without debugging. The startup project cannot be
launched. Ensure that the correct project is set as the startup
project. The startup project can be changed by selecting the 'Set as
Startup Project' command from the right click menu in Solution
Explorer.
Additionally make sure its debug settings are correctly configured in
project properties.
I've confirmed that I can CTRL+F5 with individual projects, but never with multiple. This happens across multiple, totally independent solutions - and so appears to be some non-solution/project specific issue with Visual Studio.
I also tried running Visual Studio in Safe Mode and that made no difference.
I've just had the exact same thing and it turned out to be because I'd set every project to "Start without debugging". Seems that at least one project is required to to be set to just "Start" before it will run anything..

My breakpoints don't hit when I run it for the first time?

I am using Visual Studio 2013. I use a single start up project. There are more than 8 projects in the solution. Here is what I used to do when I was on Visual Studio 2010;
I would Build the solution. Then run it from its .exe file in /bin/Debug, then on Visual Studio, I would Attach to Process and it would start debugging and it would always hit the breakpoints as long as the source code and the .exe are not different.
This is the same thing that I do on Visual Studio 2013. I put the breakpoints in a file in my startup project. I build the solution (it says it successfully builded on the output window), or I Start Without Debugging, then attach to process, it says "The breakpoint will not currently be hit. The source code is different from the original version" Then I stop debugging, and without building again, I run the .exe again, attach it, then the breakpoints start hitting. Why do I have to close my .exe and then start it again? I use attach to process a lot and this 'must do twice to hit' is really annoying. I haven't change any configuration or anything. What am I doing wrong? I swear I don't change the source code. Not even a single space. It says "Build succeeded" when I attach it.
I have a similar issue. (on a webproject)
my temp solution:
right click the web project
Select Property Pages
Under Build --> Change the Target Framework to something else than the one selected (Apply the new framework)
Then Change back to your desired framework and Debug

How to set the startup project in Expression Blend 2

Does any one know how to set the startup project in Expression Blend 2? I have a solution which builds 2 executable files. I've set the Startup Project to the one I want to debug in Visual Studio and when I run it from VS that project launches no problem. However if I open the solution in Blend and press F5 to run it the other project always launches.
There doesn't seem to be a way of setting the Startup project in Blend, and it does seem to respect the setting in Visual Studio. Or am I missing something?
Why does Blend always launch the other project and is there anyway I can change this?
Thanks
Kaneda
In the project explorer (Blend), right-click the project name within the solution and make sure 'Startup Project' is checked.
I've only got Blend 3 RC to check on at the moment but I'm pretty sure this was also in Blend 2.
Ok, I see. Turns out that the feature was added with SP1 and I didn't have that installed. Installed that, now my solution launches properly

Resources