How to set startup project in Visual Studio?

C

Curious

I have two projects in C#.NET. One is "Monitor". It creates an
executable called "Monitor.exe". The other is "CoreEngine" and its
output is a .dll file called "CoreEngine.dll".

"Monitor.exe" depends on "CoreEngine.dll". That is, I must put
"CoreEngine.dll" in the bin folder together with "Monitor.exe" in
order to run "Monitor.exe".


Now I'll need to debug "CoreEngine.dll". I'll need to set
"Monitor.exe" as the startup project in "CoreEngine". What are the
steps to set this up in "CoreEngine.dll" in Visual Studio 2005?


Thanks!
 
S

Scott M.

When you open your solution in VS 2005 and the two projects are visible in
the Solution Explorer, just right click on the Monitor project and choose
"Set as starup project".

You can also right click on the Solution node of the Solution Explorer
window and choose properties. This will bring you to the solution's
properties where you can also set the build configuration.

-Scott
 
C

Curious

Thank you Scott for the suggestion!

Good news is that when I hit F5, "Monitor.exe" is launched.

Bad news is that the breakpoints in "CoreEngine" are all skipped in
the debugger.

Any advice?
 
S

Scott M.

Ahhh, well that answers your question about why the debugger won't step into
the .dll.

You can make them part of the same solution by opening the Monitor.exe
project and then choosing File..Add...Project and locating the project file
for the .dll project. Then you'll be able to set a breakpoint and have it
step into the .dll code.

-Scott
 
C

Curious

Scott,

Thanks. Since I'm not allowed to combine the two projects in the same
solution, I did the following and it works:

1) Set "Monitor.exe" as startup project;
2) Copy "CoreEngine.dll" and "CoreEngine.pdb" to the Bin folder where
"Monitor.exe" is located.
 
C

Cowboy \(Gregory A. Beamer\)

1. Make sure both are in the same solution. You can create a new solution if
you want.
2. Make sure the monitor program uses the project version of core engine and
not a precompiled version
3. Set monitor as the startup project

You should now be able to break in both projects.

Another option is to create unit tests (nUnit?) and use them to test the
core engine without starting the monitor.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box!
|
*************************************************
 
C

Curious

Greg,

Thanks. I did what you suggested below (except that I couldn't join
both projects in a single solution):
1. Make sure both are in the same solution. You can create a new solution if
you want.
2. Make sure the monitor program uses the project version of core engine and
not a precompiled version
3. Set monitor as the startup project

And it works.

How can I perform unit test in Visual Studio of "CoreEngine" without a
startup project?
 
S

Scott M.

Thanks. I did what you suggested below (except that I couldn't join
both projects in a single solution):

Why not? No one is saying it must be a permenant action. You can just open
the Monitor project and add the .dll project to the same solution just for
testing purposes. You don't have to compile/deploy the two parts this way.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top