How to set startup project in Visual Studio?

How to set startup project in Visual Studio?

am 10.10.2007 17:57:17 von Fir5tSight

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!

Re: How to set startup project in Visual Studio?

am 10.10.2007 18:14:12 von s-mar

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

"Curious" wrote in message
news:1192031837.040012.242700@19g2000hsx.googlegroups.com...
>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!
>

Re: How to set startup project in Visual Studio?

am 10.10.2007 18:52:51 von Fir5tSight

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?

Re: How to set startup project in Visual Studio?

am 10.10.2007 18:53:32 von Fir5tSight

FYI, the two projects don't belong to the same solution.

Re: How to set startup project in Visual Studio?

am 10.10.2007 19:46:30 von s-mar

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


"Curious" wrote in message
news:1192035212.930545.319740@r29g2000hsg.googlegroups.com.. .
> FYI, the two projects don't belong to the same solution.
>

Re: How to set startup project in Visual Studio?

am 10.10.2007 20:04:20 von Fir5tSight

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.

Re: How to set startup project in Visual Studio?

am 10.10.2007 21:09:09 von NoSpamMgbworld

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!
|
*************************************************
"Curious" wrote in message
news:1192031837.040012.242700@19g2000hsx.googlegroups.com...
>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!
>

Re: How to set startup project in Visual Studio?

am 10.10.2007 21:35:51 von Fir5tSight

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?

Re: How to set startup project in Visual Studio?

am 11.10.2007 02:11:37 von s-mar

> 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.