![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Error loading system MshSnapIns exception from C# dll Hi All, I've written a C# dll - a wrapper around Exchange cmdlets. I'm calling it from unmanaged C++ code by COM callable wrapper around my C# dll. The call to CoCreateInstance( ) returns S_OK with the same error "Error loading system MshSnapins" but when my C# dll's Initialize( ) function is executed from my C++ client, I get this exception from the dll. (It works perfectly fine if the same code runs in an EXE) System.Management.Automation.Runspaces.MshSnapInException: Error loading system MshSnapIns. ---> System.Management.Automation.MshArgumentException: Unable to access Monad registry information. at System.Management.Automation.MshSnapInReader.GetMonadRootKey() at System.Management.Automation.MshSnapInReader.GetMshEngineKey(String mshVersion) at System.Management.Automation.MshSnapInReader.ReadEngineMshSnapIns() at System.Management.Automation.Runspaces.MshConsoleInfo.CreateDefaultConfiguration() --- End of inner exception stack trace --- at System.Management.Automation.Runspaces.MshConsoleInfo.CreateDefaultConfiguration() at System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.CreateDefaultConfiguration() at System.Management.Automation.Runspaces.RunspaceConfiguration.Create() at Microsoft.Exchange.Configuration.MonadDataProvider.MonadRunspaceConfiguration.Create() at MonadWrapper.MonadCmdlets.Initialize() My Initialize function in C# dll looks like this: public int Initialize() { try { AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(AssemblyResolver); rc = MonadRunspaceConfiguration.Create(); r = RunspaceFactory.CreateRunspace(rc); r.Open(); ri = new RunspaceInvoke(r); } catch (Exception ex) { Console.WriteLine(ex.ToString()); return -1; } } Thanks, Varun |
My System Specs![]() |
| | #2 (permalink) |
| | RE: Error loading system MshSnapIns exception from C# dll It seems as thought this is a problem with MSH. Would you try to upgrade to Powershell RC1 updates and then try it out ? You never know if a problem is fixed or not in recent version of PowerShell. By the way, how are these variables, "rc, r, ri" declared in your class? "Varun Bansal" wrote: > Hi All, > > I've written a C# dll - a wrapper around Exchange cmdlets. I'm calling it > from unmanaged C++ code by COM callable wrapper around my C# dll. The call > to CoCreateInstance( ) returns S_OK with the same error "Error loading > system MshSnapins" but when my C# dll's Initialize( ) function is executed > from my C++ client, I get this exception from the dll. (It works perfectly > fine if the same code runs in an EXE) > > System.Management.Automation.Runspaces.MshSnapInException: Error loading > system MshSnapIns. ---> System.Management.Automation.MshArgumentException: > Unable to access Monad registry information. > at System.Management.Automation.MshSnapInReader.GetMonadRootKey() > at System.Management.Automation.MshSnapInReader.GetMshEngineKey(String > mshVersion) > at System.Management.Automation.MshSnapInReader.ReadEngineMshSnapIns() > at > System.Management.Automation.Runspaces.MshConsoleInfo.CreateDefaultConfiguration() > --- End of inner exception stack trace --- > at > System.Management.Automation.Runspaces.MshConsoleInfo.CreateDefaultConfiguration() > at > System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.CreateDefaultConfiguration() > at System.Management.Automation.Runspaces.RunspaceConfiguration.Create() > at > Microsoft.Exchange.Configuration.MonadDataProvider.MonadRunspaceConfiguration.Create() > at MonadWrapper.MonadCmdlets.Initialize() > > My Initialize function in C# dll looks like this: > > public int Initialize() > { > try > { > AppDomain.CurrentDomain.AssemblyResolve += new > ResolveEventHandler(AssemblyResolver); > rc = MonadRunspaceConfiguration.Create(); > r = RunspaceFactory.CreateRunspace(rc); > r.Open(); > ri = new RunspaceInvoke(r); > } > catch (Exception ex) > { > Console.WriteLine(ex.ToString()); > return -1; > } > } > > > Thanks, > Varun > > > > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Error loading system MshSnapIns exception from C# dll The error seems pretty specifc to MSH engine, and I haven't seen this before at least on the Exchange side so I'll let the PS devs comment on this one. "DBMwS" <DBMwS@discussions.microsoft.com> wrote in message news:59B8281C-E4F6-4652-ACBD-C3736C077A33@microsoft.com... > It seems as thought this is a problem with MSH. > Would you try to upgrade to Powershell RC1 updates and then try it out ? > You never know if a problem is fixed or not in recent version of > PowerShell. > > By the way, how are these variables, "rc, r, ri" declared in your class? > > "Varun Bansal" wrote: > >> Hi All, >> >> I've written a C# dll - a wrapper around Exchange cmdlets. I'm calling it >> from unmanaged C++ code by COM callable wrapper around my C# dll. The >> call >> to CoCreateInstance( ) returns S_OK with the same error "Error loading >> system MshSnapins" but when my C# dll's Initialize( ) function is >> executed >> from my C++ client, I get this exception from the dll. (It works >> perfectly >> fine if the same code runs in an EXE) >> >> System.Management.Automation.Runspaces.MshSnapInException: Error loading >> system MshSnapIns. ---> >> System.Management.Automation.MshArgumentException: >> Unable to access Monad registry information. >> at System.Management.Automation.MshSnapInReader.GetMonadRootKey() >> at System.Management.Automation.MshSnapInReader.GetMshEngineKey(String >> mshVersion) >> at System.Management.Automation.MshSnapInReader.ReadEngineMshSnapIns() >> at >> System.Management.Automation.Runspaces.MshConsoleInfo.CreateDefaultConfiguration() >> --- End of inner exception stack trace --- >> at >> System.Management.Automation.Runspaces.MshConsoleInfo.CreateDefaultConfiguration() >> at >> System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.CreateDefaultConfiguration() >> at >> System.Management.Automation.Runspaces.RunspaceConfiguration.Create() >> at >> Microsoft.Exchange.Configuration.MonadDataProvider.MonadRunspaceConfiguration.Create() >> at MonadWrapper.MonadCmdlets.Initialize() >> >> My Initialize function in C# dll looks like this: >> >> public int Initialize() >> { >> try >> { >> AppDomain.CurrentDomain.AssemblyResolve += new >> ResolveEventHandler(AssemblyResolver); >> rc = MonadRunspaceConfiguration.Create(); >> r = RunspaceFactory.CreateRunspace(rc); >> r.Open(); >> ri = new RunspaceInvoke(r); >> } >> catch (Exception ex) >> { >> Console.WriteLine(ex.ToString()); >> return -1; >> } >> } >> >> >> Thanks, >> Varun >> >> >> >> |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Error loading system MshSnapIns exception from C# dll Hi Vivek, I tried upgrading the powershell to RC1 but current build of Exchange (version 08.00.0556.008) doesnt recognize it and it wants the older version of Microsoft command shell so I have to uninstall the RC1 and install the older version and the problem persists. btw, can you suggest me the exchange cluster cmdlets which can give me information and status about the cluster nodes? Thanks, Varun "Vivek Sharma [MSFT]" <viveksha@online.microsoft.com> wrote in message news:eAK%23nk8fGHA.4004@TK2MSFTNGP04.phx.gbl... > The error seems pretty specifc to MSH engine, and I haven't seen this > before at least on the Exchange side so I'll let the PS devs comment on > this one. > > "DBMwS" <DBMwS@discussions.microsoft.com> wrote in message > news:59B8281C-E4F6-4652-ACBD-C3736C077A33@microsoft.com... >> It seems as thought this is a problem with MSH. >> Would you try to upgrade to Powershell RC1 updates and then try it out ? >> You never know if a problem is fixed or not in recent version of >> PowerShell. >> >> By the way, how are these variables, "rc, r, ri" declared in your class? >> >> "Varun Bansal" wrote: >> >>> Hi All, >>> >>> I've written a C# dll - a wrapper around Exchange cmdlets. I'm calling >>> it >>> from unmanaged C++ code by COM callable wrapper around my C# dll. The >>> call >>> to CoCreateInstance( ) returns S_OK with the same error "Error loading >>> system MshSnapins" but when my C# dll's Initialize( ) function is >>> executed >>> from my C++ client, I get this exception from the dll. (It works >>> perfectly >>> fine if the same code runs in an EXE) >>> >>> System.Management.Automation.Runspaces.MshSnapInException: Error loading >>> system MshSnapIns. ---> >>> System.Management.Automation.MshArgumentException: >>> Unable to access Monad registry information. >>> at System.Management.Automation.MshSnapInReader.GetMonadRootKey() >>> at >>> System.Management.Automation.MshSnapInReader.GetMshEngineKey(String >>> mshVersion) >>> at >>> System.Management.Automation.MshSnapInReader.ReadEngineMshSnapIns() >>> at >>> System.Management.Automation.Runspaces.MshConsoleInfo.CreateDefaultConfiguration() >>> --- End of inner exception stack trace --- >>> at >>> System.Management.Automation.Runspaces.MshConsoleInfo.CreateDefaultConfiguration() >>> at >>> System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.CreateDefaultConfiguration() >>> at >>> System.Management.Automation.Runspaces.RunspaceConfiguration.Create() >>> at >>> Microsoft.Exchange.Configuration.MonadDataProvider.MonadRunspaceConfiguration.Create() >>> at MonadWrapper.MonadCmdlets.Initialize() >>> >>> My Initialize function in C# dll looks like this: >>> >>> public int Initialize() >>> { >>> try >>> { >>> AppDomain.CurrentDomain.AssemblyResolve += new >>> ResolveEventHandler(AssemblyResolver); >>> rc = MonadRunspaceConfiguration.Create(); >>> r = RunspaceFactory.CreateRunspace(rc); >>> r.Open(); >>> ri = new RunspaceInvoke(r); >>> } >>> catch (Exception ex) >>> { >>> Console.WriteLine(ex.ToString()); >>> return -1; >>> } >>> } >>> >>> >>> Thanks, >>> Varun >>> >>> >>> >>> > > |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Error loading system MshSnapIns exception from C# dll We will look into the issue. -- Abhishek Agrawal [MSFT] Windows PowerShell Team Microsoft Corporation This posting is provided "AS IS" with no warranties, and confers no rights. "Varun Bansal" <varun_bits@yahoo.com> wrote in message news:Oh7ijFyfGHA.5088@TK2MSFTNGP02.phx.gbl... > Hi All, > > I've written a C# dll - a wrapper around Exchange cmdlets. I'm calling it > from unmanaged C++ code by COM callable wrapper around my C# dll. The call > to CoCreateInstance( ) returns S_OK with the same error "Error loading > system MshSnapins" but when my C# dll's Initialize( ) function is executed > from my C++ client, I get this exception from the dll. (It works perfectly > fine if the same code runs in an EXE) > > System.Management.Automation.Runspaces.MshSnapInException: Error loading > system MshSnapIns. ---> System.Management.Automation.MshArgumentException: > Unable to access Monad registry information. > at System.Management.Automation.MshSnapInReader.GetMonadRootKey() > at System.Management.Automation.MshSnapInReader.GetMshEngineKey(String > mshVersion) > at System.Management.Automation.MshSnapInReader.ReadEngineMshSnapIns() > at > System.Management.Automation.Runspaces.MshConsoleInfo.CreateDefaultConfiguration() > --- End of inner exception stack trace --- > at > System.Management.Automation.Runspaces.MshConsoleInfo.CreateDefaultConfiguration() > at > System.Management.Automation.Runspaces.RunspaceConfigForSingleShell.CreateDefaultConfiguration() > at System.Management.Automation.Runspaces.RunspaceConfiguration.Create() > at > Microsoft.Exchange.Configuration.MonadDataProvider.MonadRunspaceConfiguration.Create() > at MonadWrapper.MonadCmdlets.Initialize() > > My Initialize function in C# dll looks like this: > > public int Initialize() > { > try > { > AppDomain.CurrentDomain.AssemblyResolve += new > ResolveEventHandler(AssemblyResolver); > rc = MonadRunspaceConfiguration.Create(); > r = RunspaceFactory.CreateRunspace(rc); > r.Open(); > ri = new RunspaceInvoke(r); > } > catch (Exception ex) > { > Console.WriteLine(ex.ToString()); > return -1; > } > } > > > Thanks, > Varun > > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| error loading operating system on restart | General Discussion | |||
| Error loading operating system | Vista installation & setup | |||
| Can't get into Safe Mode/Error loading Operating System | Vista General | |||
| Vista Install Error: Exception Unknown Software Exception | Vista installation & setup | |||