System.Windows.Forms namespace not recognized in Windows Service
Solution 1
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)
Solution 2
you need to add reference to it's assembly
right click your project node in solutions explorer and
choose AddReference --> .Net -->System.Windows.Forms
Sam Youtsey
Updated on June 26, 2022Comments
-
Sam Youtsey over 1 year
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.