question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Need check OS version in installation packages and maybe binary

See original GitHub issue

I install PowerShell-6.0.0-beta.4-win10-win2016-x64.msi on Windows Server 2012 R2 and get an exception (see test below). The same package I install on Windows Server 2012 - no exception with the same test.

Conclusion: we should check OS version in our packages and block setup on inappropriate OS version.

Discussion: User can copy-paste folder with installed PowerShell Core from one OS to one with inappropriate version and get unpredictable results. We should to protect in some way. Maybe have a manifest to check dll versions at startup. (Microsoft.Management.Infrastructure.Native.Unmanaged.DLL version is the same in Win10 and Win81 packagees).

I test Test-Connection computername on Windows Server 2012 R2. The Microsoft.Management.Infrastructure.Native.Unmanaged.DLL is present in root PowerShell Core folder.

TypeName       : Microsoft.Management.Infrastructure.Native.ApplicationMethods
Message        : The type initializer for 'Microsoft.Management.Infrastructure.
                 Native.ApplicationMethods' threw an exception.
Data           : {}
InnerException : System.DllNotFoundException: Unable to load DLL
                 'Microsoft.Management.Infrastructure.Native.Unmanaged.DLL':
                 The specified module could not be found. (Exception from
                 HRESULT: 0x8007007E)
                    at
                 MI_ApplicationWrapper_Initialize(_MI_ApplicationWrapper* ,
                 UInt16* , IntPtr , IntPtr , IntPtr , IntPtr , IntPtr , IntPtr
                 , IntPtr , IntPtr , IntPtr , IntPtr , IntPtr , IntPtr ,
                 IntPtr )
                    at Microsoft.Management.Infrastructure.Native.MI_Applicatio
                 nWrapper_Initialize_Managed(_MI_ApplicationWrapper*
                 pmiApplicationWrapper)
                    at Microsoft.Management.Infrastructure.Native.ApplicationMe
                 thods.InitializeCore(InstanceHandle& errorDetails,
                 ApplicationHandle& applicationHandle)
                    at Microsoft.Management.Infrastructure.Native.ApplicationMe
                 thods..cctor()
TargetSite     : Microsoft.Management.Infrastructure.Native.MiResult Initialize
                 (Microsoft.Management.Infrastructure.Native.InstanceHandle
                 ByRef,
                 Microsoft.Management.Infrastructure.Native.ApplicationHandle
                 ByRef)
StackTrace     :    at Microsoft.Management.Infrastructure.Native.ApplicationMe
                 thods.Initialize(InstanceHandle& errorDetails,
                 ApplicationHandle& applicationHandle)
                    at Microsoft.Management.Infrastructure.Internal.CimApplicat
                 ion.GetApplicationHandle()
                    at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
                    at System.Lazy`1.ExecutionAndPublication(LazyHelper
                 executionAndPublication, Boolean useDefaultConstructor)
                    at System.Lazy`1.CreateValue()
                    at Microsoft.Management.Infrastructure.Options.CimOperation
                 Options.<>c__DisplayClass9_0.<.ctor>b__0()
                    at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
                    at System.Lazy`1.ExecutionAndPublication(LazyHelper
                 executionAndPublication, Boolean useDefaultConstructor)
                    at System.Lazy`1.CreateValue()
                    at Microsoft.Management.Infrastructure.Options.CimOperation
                 Options.set_Timeout(TimeSpan value)
                    at Microsoft.PowerShell.Commands.TestConnectionCommand.Proc
                 essWSManProtocolForTestConnection()
                    at Microsoft.PowerShell.Commands.TestConnectionCommand.Proc
                 essRecord()
                    at System.Management.Automation.Cmdlet.DoProcessRecord()
                    at
                 System.Management.Automation.CommandProcessor.ProcessRecord()
HelpLink       :
Source         : Microsoft.Management.Infrastructure.Native
HResult        : -2146233036

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
iSazonovcommented, Sep 18, 2017

I get an error on Windows Server 2012 for Test-Connection with Beta.7. 😕 I guess we can catch more errors if we run full test set on all supported platforms.

0reactions
iSazonovcommented, Sep 19, 2017

The error is absent in previous builds - it is up with unified Windows packages.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Meaning of common message when install a package ...
When installing packages, the message There are binary versions available but the source versions are later often appears. This is (I think) followed...
Read more >
Install.packages installs source in Rstudio console but ...
Summary. I have Rtools 3.5 installed (which devtools can find using both routes and thinks it is not compatible..., but installing from source ......
Read more >
Optionally install existing binary version if source is newer?
The only catch is that any:: requires a newer dev version of pak, and our repo does not have a binary. So you...
Read more >
Binary vs. Source Packages: Which Should You Use?
Linux users have two main ways to install software: use a pre-built package or compile from source. Here's what you need to know....
Read more >
What is Binary package? How to build them?
I want to get detail about binary package and run them on linux. I am running Debian base (Ubuntu/Linux mint) Linux os. How...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found