Alex, http://tinyurl.com/efdlg
may also be of interest. Seeya Matthew Wills | Senior Analyst Programmer | Adviser Tools and Services| Financial Planning and Third Party | NAB Technology | Wealth Management Australia |---------+-------------------------------------> | | Alex Smotritsky | | | <[EMAIL PROTECTED]| | | > | | | Sent by: "Discussion of | | | advanced .NET topics." | | | <[EMAIL PROTECTED]| | | EVELOP.COM> | | | | | | | | | 29/09/2006 01:39 PM | | | Please respond to | | | "Discussion of advanced | | | .NET topics." | | | | |---------+-------------------------------------> >--------------------------------------------------------------------------------------------------------------| | | | 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 e-mail is sent by or on behalf of the named sender identified above. If: (a) you do not wish to receive any e-mail marketing material from this person in the future, please forward the contents of this email to [EMAIL PROTECTED] with the word "unsubscribe" in the subject box. (b) you wish to unsubscribe from all central e-mail marketing lists used by our business, please forward the contents of this e-mail to [EMAIL PROTECTED] with the message "unsubscribe from all central e-mail marketing lists" in the subject box. If you do not forward the contents of this e-mail with your unsubscription then it may not be able to be implemented. The information contained in this e-mail communication may be confidential. You should only read, disclose, re-transmit, copy, distribute, act in reliance on or commercialise the information if you are authorised to do so. If you are not the intended recipient of this e-mail communication, please immediately notify us by e-mail to [EMAIL PROTECTED], or reply by e-mail direct to the sender and then destroy any electronic and paper copy of this message. Any views expressed in this e-mail communication are those of the individual sender, except where the sender specifically states them to be the views of a member of the National Australia Bank Group of companies. Any advice contained in this e-mail has been prepared without taking into account your objectives, financial situation or needs. Before acting on any advice in this e-mail, National Australia Bank Limited recommends that you consider whether it is appropriate for your circumstances. If this e-mail contains reference to any financial products, the National recommends you consider the Product Disclosure Statement (PDS) or other disclosure document before making any decisions regarding any products. The National Australia Bank Group of companies does not represent, warrant or guarantee that the integrity of this communication has been maintained nor that the communication is free of errors, virus or interference. =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com