Main Site Documentation

Problem with solution with multiple console applications


#1

I am working with a Cobra, I think this is a Visual Studio. Issue.

I am using the premium edition of VS 2010.

I have a solution with two console applications and one class library.

If I select the first console app that was added to the solution by right clicking on project in Solution Explorer and make it the Startup Project, hitting F5 or the debug icon causes the first app loads and runs.

If I then make the second console app the Startup Project, hitting F5 or the debug start icon, causes the FIRST app to load and run, not the second app, which is the Startup project.

If I right click on the second project and then go to Debug->Start New Instance, the second project loads and runs.

I have not reloaded the MS SDK or GHI SDK yet.

This problem sound familar to anyone?

Thanks,
Mike


#2

I had that issue. The only way I solved it is by having only one executable in the solution.


#3

I might have found the cause, and a work around.

When I start working on a software effort, I create an empty solution and then add projects to it. That way, the first project does not have the name of the solution.

I decided to see what would happen if I created the solution and the first project at the same time, and then added a project. While I have not done a lot of testing, I seem to be able to go back and forth between the two executable projects. It seems to work.

I suspect there is some issue with a MF project going into an empty solution.

I will move the software I was working on into the solution I just created tomorrow, and see if it continues to work correctly.


#4

Mike, I have this issue with several editions of VS2010 and it does not matter that the solution was not empty when I created it. I suspect that even though we set the startup project, the entire solution gets deployed to the hardware. hen we have a situation where there are multiple main() functions and for some reason does not know which is the startup project. I have seen inconsistent behavior where sometimes it works and other times it does not. My work-around has been to set all other projects to not deploy in the buil settings for the solution (as suggested by another user in a different thread some time ago).


#5

Bob, further testing proved that you were right. Inconsistant…

Oh well, I will have to live with it.

BYW, I loaded the SP1 beta for VS2010, and it did not help.


#6

Create additional solution configurations. Create “Debug - Proj A”, “Debug - Proj B”. Set B to not build in A, and A to not build in B.

Right click your solution, open Properties, select Configuration Manager.