473,396 Members | 2,087 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

WMI in a webservice

J
Hello,

I'm trying to create a webservice that will return a list of all
printers on the machine that is running the webservice. I was hoping to do
this via WMI and System.Management.

But when I'm trying to create the webservice in .NET and I add the following
line

using System.Management

I get the error "The type or namespace name does not exist in the class or
namespace 'System'.

Why am I getting this error? Am I not allowed to use a WMI in a webservice?

Thanks in Advance
Nov 23 '05 #1
6 3968
"J" <A@b.c> wrote in news:ew**************@TK2MSFTNGP09.phx.gbl:
But when I'm trying to create the webservice in .NET and I add the
following line

using System.Management

I get the error "The type or namespace name does not exist in the class
or namespace 'System'.

Why am I getting this error? Am I not allowed to use a WMI in a
webservice?


You have to add the assembly to your references also.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Blog: http://blogs.atozed.com/kudzu
Nov 23 '05 #2
"J" <A@b.c> wrote in news:ew**************@TK2MSFTNGP09.phx.gbl:
But when I'm trying to create the webservice in .NET and I add the
following line

using System.Management

I get the error "The type or namespace name does not exist in the class
or namespace 'System'.

Why am I getting this error? Am I not allowed to use a WMI in a
webservice?


You have to add the assembly to your references also.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Blog: http://blogs.atozed.com/kudzu
Nov 23 '05 #3

"J" <A@b.c> wrote in message news:ew**************@TK2MSFTNGP09.phx.gbl...
Hello,

I'm trying to create a webservice that will return a list of all
printers on the machine that is running the webservice. I was hoping to do
this via WMI and System.Management.

But when I'm trying to create the webservice in .NET and I add the
following line

using System.Management


I'm not having the error at first sight.

Did you add a reference to System.Management?

Brecht
Nov 23 '05 #4

"J" <A@b.c> wrote in message news:ew**************@TK2MSFTNGP09.phx.gbl...
Hello,

I'm trying to create a webservice that will return a list of all
printers on the machine that is running the webservice. I was hoping to do
this via WMI and System.Management.

But when I'm trying to create the webservice in .NET and I add the
following line

using System.Management


I'm not having the error at first sight.

Did you add a reference to System.Management?

Brecht
Nov 23 '05 #5
Hi,

I have had the same problem once, I do not know, because it was not
happening on the development machine, but I am speaking about a web-page,
not a webservice, but this might be the same. I added the following to my
web.config file:

---- snip ----

<configuration>

<configSections>
<sectionGroup name="system.web"/>
</configSections>
<system.web>

<compilation
defaultLanguage="c#"
debug="true"
<assemblies>
<add assembly="System.Management, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, Custom=null"/>
</assemblies>

</compilation>

--- snip ---

If I used code-behind, this was not an issue.

May be, that helps!
Best regards,
Manfred Braun

(Private)
Mannheim
Germany

mailto:_m*************@manfbraun.de
(Remove the anti-spam-underscore to mail me!)

"J" <A@b.c> wrote in message news:ew**************@TK2MSFTNGP09.phx.gbl... Hello,

I'm trying to create a webservice that will return a list of all
printers on the machine that is running the webservice. I was hoping to do
this via WMI and System.Management.

But when I'm trying to create the webservice in .NET and I add the following line

using System.Management

I get the error "The type or namespace name does not exist in the class or
namespace 'System'.

Why am I getting this error? Am I not allowed to use a WMI in a webservice?
Thanks in Advance

Nov 23 '05 #6
Hi,

I have had the same problem once, I do not know, because it was not
happening on the development machine, but I am speaking about a web-page,
not a webservice, but this might be the same. I added the following to my
web.config file:

---- snip ----

<configuration>

<configSections>
<sectionGroup name="system.web"/>
</configSections>
<system.web>

<compilation
defaultLanguage="c#"
debug="true"
<assemblies>
<add assembly="System.Management, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, Custom=null"/>
</assemblies>

</compilation>

--- snip ---

If I used code-behind, this was not an issue.

May be, that helps!
Best regards,
Manfred Braun

(Private)
Mannheim
Germany

mailto:_m*************@manfbraun.de
(Remove the anti-spam-underscore to mail me!)

"J" <A@b.c> wrote in message news:ew**************@TK2MSFTNGP09.phx.gbl... Hello,

I'm trying to create a webservice that will return a list of all
printers on the machine that is running the webservice. I was hoping to do
this via WMI and System.Management.

But when I'm trying to create the webservice in .NET and I add the following line

using System.Management

I get the error "The type or namespace name does not exist in the class or
namespace 'System'.

Why am I getting this error? Am I not allowed to use a WMI in a webservice?
Thanks in Advance

Nov 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: DraguVaso | last post by:
Hi, I'm new to WebServices, and I'm doing some tests (with a small VB.NET-application) to know the performance-difference between a WebService and the 'normal'-way of getting data (just...
6
by: Davie | last post by:
I want to authorise a user of a web service by using the AuthHeaderValue for some reason I keep getting a null reference exception when I try to run the following code: It seems to work fine on a...
1
by: Nalaka | last post by:
Hi, I am testing with Visual studio 2005, web projects. Situation: I have one solution with two web projects, created as file system projects. (I am tesing using the built in server, not IIS)...
2
by: Miguel | last post by:
Hi, I'm developing an application in C# with Windows Forms for my company that is similar to the MSN Messenger. This application uses a webservice for registering users, etc... and as 2...
7
by: Alessandro Benedetti | last post by:
Hi. I'm calling two methods of a .NET Webservice (A) from another Webservice (B). The A Webservice is made like this: public class WSA: System.Web.Services.WebService { private int X = 0;
7
by: Nalaka | last post by:
Hi, I created a sinple web service that returns a dataSet. Then I created a client program that uses this web service (that returns the Dataset). My question is, how did the client figure...
5
by: AliR | last post by:
Hi Everyone, I have a Visual C++ MFC program, and I am trying to use a webservice written in C#. When I add the webservice to my project using Add Web Reference the sproxy compiler complains...
5
by: | last post by:
Hi, How long do webservice objects live for? In particular, if i have static variables filled with data from a static constructor in a webservice, how long will that data persist? thxs
0
by: =?Utf-8?B?TWFuaQ==?= | last post by:
Hi All, Problem in deploying my WebService developed using Asp.net WebServices 2005. I have designed simple WebService using Asp.net Webservices 2.0 , The webservice look this , using System;...
4
by: =?Utf-8?B?QmlsbEF0V29yaw==?= | last post by:
Hi, We recently converted a 1.1 project to 2.0 and this included a webservice which accepted XML for one of the parameters. Since converting to 2.0 I am getting the following message: --- A...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.