System.Windows.Forms namespace not recognized in Windows Service

c#, namespaces, windows-services

Solution

Add a reference to System.Windows.Forms in the project.

Here is how you do it: (copied from the user below - thankyou!):

you need to add reference to it's assembly

right click your project node in solutions explorer and

choose AddReference --> .Net -->System.Windows.Forms

Just make sure that you don't call MessageBox from your service. It is not a smart thing to do. (Yes, I have blocked services that way)

Problem

I've got a service that's acting up. It won't recognize the following namespace declaration: ``` using System.Windows.Forms; ``` What I most need from the Windows.Forms namespace is a WebBrowser control. Any ideas on how to get this working? Thank you.

Original source