Re: Connect on ManagementScope throws: BadImageFormatException

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

From: Chung-Wei Foong [MSFT] (chungwf_at_online.microsoft.com)
Date: 03/16/04


Date: Tue, 16 Mar 2004 15:02:38 -0800

Just to isolate the problem even further between managed code and unmanaged
code, do you get this exception with wbemtest?

Thanks

-- 
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Steen Tøttrup" <never@mind.com> wrote in message
news:eyIubB4CEHA.2556@TK2MSFTNGP12.phx.gbl...
> It's a local connection, so the username/password is never set (I only set
> it when it's a remote connection).
>
>
>
>
> "Chung-Wei Foong [MSFT]" <chungwf@online.microsoft.com> wrote in message
> news:uxH5fs3CEHA.1588@tk2msftngp13.phx.gbl...
> > Is this a local or remote connection? Does this work if you explicitly
> > specify the password and username instead of going through
> > System.Configuration.ConfigurationSettings?
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> > Use of any included script samples are subject to the terms specified at
> > http://www.microsoft.com/info/cpyright.htm
> >
> >
> > "Steen Tøttrup" <never@mind.com> wrote in message
> > news:eqGmt92CEHA.684@tk2msftngp13.phx.gbl...
> > >
> > > Didn't help.!
> > >
> > > Still same exception, I'm without a clue, but thanks anyway!
> > >
> > > best regards,
> > > Steen
> > >
> > >
> > > "Chung-Wei Foong [MSFT]" <chungwf@online.microsoft.com> wrote in
message
> > > news:ufGdierCEHA.3928@TK2MSFTNGP09.phx.gbl...
> > > > Set AuthenticationLevel to Packet instead of Call to see if it will
> work
> > > for
> > > > you.
> > > >
> > > > --
> > > > This posting is provided "AS IS" with no warranties, and confers no
> > > rights.
> > > > Use of any included script samples are subject to the terms
specified
> at
> > > > http://www.microsoft.com/info/cpyright.htm
> > > >
> > > > "Steen Tøttrup" <never@mind.com> wrote in message
> > > > news:u5BOBTfCEHA.1688@TK2MSFTNGP12.phx.gbl...
> > > > >
> > > > > This is what I'm doing:
> > > > >
> > > > > ConnectionOptions conOptions = new ConnectionOptions();
> > > > > conOptions.Authentication = AuthenticationLevel.Call;
> > > > > conOptions.Impersonation = ImpersonationLevel.Impersonate;
> > > > > conOptions.Username =
> > > > >
> System.Configuration.ConfigurationSettings.AppSettings["DnsUserName"];
> > > > > conOptions.Password =
> > > > >
> System.Configuration.ConfigurationSettings.AppSettings["DnsPassword"];
> > > > >
> > > > > string sServerPath = \\\\myserver\\root\\microsoftdns";
> > > > > ManagementScope oScope = new ManagementScope(sServerPath,
> conOptions);
> > > > > oScope.Connect();
> > > > >
> > > > > and BANG!, a BadImageFormatException is thrown!!
> > > > >
> > > > > "System.BadImageFormatException: Exception from HRESULT:
0x800700C1.
> > > > >    at System.Management.ManagementScope.Initialize()
> > > > >    at System.Management.ManagementScope.Connect()"
> > > > >
> > > > >
> > > > > The "funny" thing is that it works fine when run on the machine
I'm
> > > > > developing on (Windows 2000 Server), but when moved to the server
> it's
> > > > meant
> > > > > to run on (Windows 2003 Standard), I get the exception.
> > > > >
> > > > > Please help me, I've got no ideas!!
> > > > >
> > > > > best regards,
> > > > > Steen
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>


Relevant Pages

  • RE: Unmanaged exception caught how in managed code?
    ... we can catch the common language runtime exception ... Please refer to the following sample code: ... the code generated by this sample is completely managed code. ... This posting is provided "AS IS" with no warranties, ...
    (microsoft.public.dotnet.languages.vc)
  • Re: OT: Linux user forced to install Windows
    ... behaviour there, or should I assume that those guys are the exception, ... is acceptable behaviour by my standards is another issue. ... A charter would just give ... Then give the right example yourself, and obstain from OT posting too. ...
    (alt.os.linux.suse)
  • Re: Overriden method doesnt throw Exception, super may.
    ... * Class A has a method that throws an exception only because it ... > It may be true, now, that super.myMethod will never throw MyException ... Time posting on the board is irrelevant to the merits of an argument. ... I wasn't implying that you had hidden motives. ...
    (comp.lang.java.programmer)
  • Re: Can you write code directly in CIL ???
    ... Your benchmarking on perfomance is bit off posting to posting. ... > constantly access all of its memory. ... >>> managed code, even in IL, you can't stop a GC no matter what. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: MDA Loader?
    ... written code yourself that causes managed code to be executed inside the ... initialization of a DLL, you may indeed want to heed the warning. ... using Microsoft-provided components that themselves cause the exception. ... note that the MDA exceptions are part of the debugger. ...
    (microsoft.public.dotnet.languages.csharp)