Form and Service in the same Project?
Hi Guys,
Noticed for the same Visual Studio Project you can go:
Add new item > Windows Form
also
Add new item > Windows Service
Can a single project have both Forms and Services? Installation of the assembly was successfully, but didn't have luck running it. I really wonder why Microsoft made it possible to add Forms and Services to the same project.
Thanks,
McoreD
Re: Form and Service in the same Project?
What version of VS? That sounds really weird. I thought that a service was a project in itself, because it gets compile to a single EXE. How can you then add a service to another project?
Re: Form and Service in the same Project?
I think you may be confusing a Solution with a Project.
1 Attachment(s)
Re: Form and Service in the same Project?
Hi Guys, this is indeed weird. It's possible with both VS.NET 2003 and VS 2005.
Attached here is a short video -- see what I mean?
Re: Form and Service in the same Project?
Weird and interesting, and weird too! I think I'm going to have to set some time aside to look into that.
Re: Form and Service in the same Project?
jmcilhinney, that's great. I was just dumbfounded with no clue what we can achieve from that feature/capability in Visual Studio.
So many questions...
how could a Windows Service (*.exe) and a Windows Form (*.exe) compile to a single exe?
Does this mean we can have Windows Forms that can act like a Windows Service (if needed)??
If not why did Microsoft add this ability in the first place??? I am sure you share those questions (and may be more too). :)
Cheers, McoreD.
Re: Form and Service in the same Project?
It seems like Having Service and a Windows Forms GUI in the same EXE is possible! Hav a look at DynDNS Updater. They have implemented thsi sort of design. http://www.dyndns.com/support/clients/
Re: Form and Service in the same Project?
I know a service is technically not supposed to have a user interface, correct? But...what if you happened to want to display a window when some event happens within the service. I think MSDE runs as a service but displays a tray icon to help manage itself. And the windows messenger service (the one for net send that everyone disables nowadays) displays a message box (not exactly a win form though). Point is, it's all just code so there's no reason to exclude certain code from an exe.