views:

17

answers:

1

Hello, I have a windows service in VS.net 2008. Just to test the application before I install the service, I have a form (Form1.cs). Now when I want to make this project as startup project and form1 as startup object, I don't see the form one in the start up object list. I just see the namespace of the Program.cs and not set

Please help

A: 

Presumably you don't have a

static void Main()

method in Form1.cs. (The method could return int and/or take a string[] parameter, and it doesn't have to be private.) That's what makes VS consider a class to be a potential entry point.

To be honest, it's be pretty odd IMO to have a form in the same project as a service. Why not have a separate project for it which would work in the normal way? Having multiple entry points is fine, but if one of them starts a service and the other opens a form instead, that's a little strange.

Jon Skeet