tags:

views:

836

answers:

2

Guys, how can I import the System.ServiceProcess namespace into a WPF project in VB.net (not C#)? The ServiceController object is not in the toolbox in VS2008 and can't see to figure it out. Any ideas? If that particular namespace cannot be imported into WPF projects, could somebody suggest another way of controlling windows services from a WPF application? I know this framework is focused more on multimedia apps, but would really like to switch over some of my tools to WPF.

Thanks in advance!

+1  A: 

I assume you mean you want to add a project reference, rather than specifically adding it into a XAML file.

You will need to add a reference to the appropriate DLL, but it might be hidden from you if you aren't targeting the correct framework version -- make sure your project properties say you are targeting 3.5.

dhopton
+1  A: 

You need to add a reference to System.ServiceProcess.dll.

The confusing thing is that this assembly is not in C:\Program Files\Reference Assemblies\Microsoft\Framework. It should be be in the GAC; however, it might not show in the list of assemblies. You can browse to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 and reference it from there.

Franci Penov
Yeah, I found that DLL, but guess I´ll have to figure out how to reference a single file. I tried to add it to the Customize ToolBox window but it goes directly into the .Net Framework tab. Thanks a lot for the tip!