Re: CS0246: The type or namespace name 'ManagementObjectSearcher' could not be found

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Fri, 20 Mar 2009 01:01:31 -0700, CKKwan <ckkwan@xxxxxxxxxxx> wrote:

I have added System.Management as reference, and using
System.Management; in my code.

Everything compile fine (wihtout a single error / warning).

But this error occur during runtime. (Press F5 and run in debug mode).

Any idea what might have gone wrong?

That's a compiler error, not a run-time error. So the only way it could happen "during runtime" is if you are trying to compile something at run-time, but not providing the necessary reference for the compilation _at run-time_.

What that could be, is impossible to say. You haven't provided any code, never mind a concise-but-complete code sample that reliably demonstrates the problem.

Pete
.



Relevant Pages

  • Re: Debugging standard C library routines
    ... initialize all his pointers. ... couldn't /get/ a clean compile without adding spurious casts to the code, ... When is a warning significant? ... Now, when I have to debug someone else's code, that can take a bit longer, ...
    (comp.lang.c)
  • Re: warning LNK4221 with VS2005 but not with VS2003
    ... yywcsskp.obj: warning LNK4221: no public symbols found; ... when I compile a static library with VS2005. ... Is it a VS2005 known bug? ... more runtime checks in debug builds than 2003 did. ...
    (microsoft.public.vc.language)
  • Re: A basic error with cout
    ... time I compile I get the following warning ... When I compile a seccond time with no changes, I get no errors, no warnings ... identifier was truncated to '255' characters in the debug ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Stop on first error
    ... Having run a compile I could only edit one single error per editing ... list of errors I could fix many errors in one editing session before ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: CS0246: The type or namespace name ManagementObjectSearcher could not be found
    ... Everything compile fine (wihtout a single error / warning). ...
    (microsoft.public.dotnet.languages.csharp)