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..
I am just having a problem in my Visual Studio 2005. Every time I debug my code, the project is re-generated and it really takes too much time. For this reason I am looking a possibility to disable this option if possible. Can you please help me with this situation?
Right click the solution and select "Properties". There should be an entry "Configuration" (sorry, I'm using German VS, so it may be named differently). There you can check boxes that determine whether a project should be built or not.
Please note that this affects the overall build process, too. I've had situations where I wondered why changes wouldn't work until I noticed that I kept working with an old version because I unchecked the Build checkbox!
You may think this question is the exact duplicate of Running two projects at once in Visual Studio. Not really, it is the exact opposite.
I have a VS 2010 solution with two MVC3 projects. I've already configured the solution with a single startup project. However, each time I run it, VS spawns two servers with the two MVC applications (and one does not have direct dependency on the other).
So, how do I get rid of such behavior?
Click on the project you don't want to start up, go to the Properties tab, and change 'Always start when debugging' to False.
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
Firstly I'm completely aware of this message and why it happens normally. It's not that I'm just trying to run a dll (like this question).
I have a project that compiles to a dll but has a startup program specified in the project properties. Most of the time I'm able to right-click on the project and select Debug > Start new instance, and it will run the program and let me debug my dll. However, occasionally I get this message (A project with output type of class library cannot be started directly) as if I haven't got a startup program. The first few times I thought it was just me accidentally clicking on the wrong project but I'm certain this isn't the case given that it's happened so many times and I've been careful to watch it.
When this message appears I'm able to try it again and it always works on the second or third attempt.
A colleague using the same Solution never has this problem :-/
Anyone else had this problem or know how to solve it?
I'm using Visual Studio 2005 Pro Version 8.0.50727.762 (SP.050727-7600)
Edit: Also happens with Visual Studio 2010
Another colleague suggested it's because after clicking Debug > Start new instance, while I'm waiting for it to start up, I click on a different project. I don't do it for any reason, just randomly selecting things as I wait for the project to start up. Maybe Visual Studio looks at the selected project sometime after I clicked the menu, gets confused, and shows the error message?
Anyone able to confirm this matches their experience?
Typically problems in VS are caused by:
Add-ins: Run VS without and see if the problems is solved
Corrupted files in your solution: Delete / rename all files created by Visual Studio which are not part of your project, i.e. all .suo, .ncb files and a like.
I had this problem with projects that were created as "Windows Control Library" that somehow forget their status. Unloading and reloading the project usually did the trick.
If it was created as a "Class Library" then to make it a "Windows Control Library" I manually add the following to the .csproj file. It was the only difference I could see between a class library and windows control library project.
BTW - starting a Windows Control Library starts the User Control Test Container - allows you to test any user control in the library. Very cool.
<Service Include="{94E38DFF-614B-4cbd-B67C-F211BB35CE8B}" />
add that inside of an <itemgroup> element.
If you plan to use/create/add extra dll's or just have more than one project in your solution, you may get this kind of problem, especially if you forgot a simple rule:
1. In your "Solution Explorer" window. Right click and chose "Set StartUp Projects..."
2. Under "Start Up Project" select and change "Single startup project" to your working entity.
no just make a start up project
Going to resurrect this thread, I have just been experiencing similar issues, when right clicking a project and start new instance..
So instead of right clicking the project and selecting start new instance, I right clicked and clicked set as startup project.
Low and behold a class library project was set to bold, certainly not the one I was right clicking.
I tried selecting a different executable project and setting that as the startup project. Same class library was highlighted as the start up project.
Realised that the current open file was from that project, possibly all the open files were from that project...
closed all open files and tried again.... Problem solved, behaviour as expected for both set as start up project and start new instance options...
Definitely a bug, hope this helps others..
Microsoft Visual Studio 2010 Version 10.0.40219.1 SP1Rel
Microsoft .NET Framework Version 4.0.30319 SP1Rel
This sounds like a transient Visual Studio problem. Reinstallation or upgrade may solve your problem.
I've seen this as well, and it seems like a bug in VS. It happens after you right-click/build a class library (that requires rebuilding), and then right-click/debug > start new instance.
edit- It's still very intermittent, I can't seem reproduce it reliably
I've found that I've had the Startup Project on the Solution set to Current selection, then at some point, I've unloaded a project, and the solution has reverted to Single startup project on a project that happens to be a class library.