Thanks for the links, they look good, I'll see if that server needs to be
patched and such.

-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Matthew Wills
Sent: Thursday, September 28, 2006 11:54 PM
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] OS specific WMI error with .Net 1.1

Alex,

http://geekswithblogs.net/cmcneill/archive/2005/04/05/28336.aspx

suggest that .NET 1.1 SP1 may help.

Seeya
Matthew Wills | Senior Analyst Programmer | Adviser Tools and Services|
Financial Planning and Third Party | NAB Technology | Wealth Management
Australia





|---------+---------------------------->
|         |           Alex Smotritsky  |
|         |           <alex_smotritsky@|
|         |           YAHOO.COM>       |
|         |                            |
|         |                            |
|---------+---------------------------->

>---------------------------------------------------------------------------
-----------------------------------|
  |
|
  |       To:       ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
|
  |       cc:
|
  |       Subject:  Re: [ADVANCED-DOTNET] OS specific WMI error with .Net
1.1                                    |

>---------------------------------------------------------------------------
-----------------------------------|




Thanks for clearing that up. Here's the core code:

ManagementScope scope = new ManagementScope();
ConnectionOptions connection = new ConnectionOptions();
ManagementObjectSearcher searcher = new ManagementObjectSearcher();

scope = new ManagementScope("\\\\TheComputer\\root\\CIMV2", connection);
scope.Connect();

searcher.Scope = scope;
searcher.Query = new ObjectQuery("select * from Win32_Product");

ManagementObjectCollection mc = searcher.Get();

foreach(ManagementObject mo in mc)      // this throws the exception
{
        // read contents of mo
}

The specific wmi query there should be irrelevant as it happens for that
query and all the others I'm trying to run.

-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of David L. Penton
Sent: Thursday, September 28, 2006 10:14 PM
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] OS specific WMI error with .Net 1.1

He means that the new error is that you didn't include any code in your
post.  Please reply with a sample of code that reproduces
the error.

&_david++;


******************************************************************
******************************************************************
******************************************************************

I'm trying to iterate over a ManagementObjectCollection with a foreach.
When running against a Windows 2000 Advanced Server with .Net 1.1 installed
I'm getting the following error:

COM object that has been separated from its underlying RCW can not be used.

The ManagementException.ErrorCode is -2146233087.

This does not happen when running against Windows Server 2003.




______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________

===================================
This list is hosted by DevelopMentor.  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to