Skip to content

Scripts generating WPF fail after upgrading to PowerShell 7.3.0-rc.1 #18414

@wi-fr

Description

@wi-fr

Prerequisites

Steps to reproduce

Scripts generating WPF that had work on all PowerShell versions, including the PowerShell 7.3.0 Previews, fail after upgrading to PowerShell 7.3.0-rc.1.

Expected behavior

PS> [System.Windows.Window]::new().ShowDialog()

WPF Window pops up

Actual behavior

PS> [System.Windows.Window]::new().ShowDialog()

MethodInvocationException: Exception calling "ShowDialog" with "0" argument(s): "Unable to load DLL 'PenIMC_cor3.dll' or one of its dependencies: The specified module could not be found. (0x8007007E)"

Error details

PS> Get-Error

Exception             : 
    Type           : System.Management.Automation.MethodInvocationException
    ErrorRecord    : 
        Exception             : 
            Type    : System.Management.Automation.ParentContainsErrorRecordException
            Message : Exception calling "ShowDialog" with "0" argument(s): "Unable to load DLL      
'PenIMC_cor3.dll' or one of its dependencies: The specified module could not be found. (0x8007007E)"
            HResult : -2146233087
        CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException
        FullyQualifiedErrorId : DllNotFoundException
        InvocationInfo        : 
            ScriptLineNumber : 1
            OffsetInLine     : 2
            HistoryId        : -1
            Line             :  [System.Windows.Window]::new().ShowDialog()
            PositionMessage  : At line:1 char:2
                               +  [System.Windows.Window]::new().ShowDialog()
                               +  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            CommandOrigin    : Internal
        ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1
    TargetSite     : 
        Name          : ConvertToMethodInvocationException
        DeclaringType : System.Management.Automation.ExceptionHandlingOps, 
System.Management.Automation, Version=7.3.0.101, Culture=neutral, PublicKeyToken=31bf3856ad364e35   
        MemberType    : Method
        Module        : System.Management.Automation.dll
    Message        : Exception calling "ShowDialog" with "0" argument(s): "Unable to load DLL       
'PenIMC_cor3.dll' or one of its dependencies: The specified module could not be found. (0x8007007E)"
    Data           : System.Collections.ListDictionaryInternal
    InnerException : 
        Type       : System.DllNotFoundException
        Message    : Unable to load DLL 'PenIMC_cor3.dll' or one of its dependencies: The specified 
module could not be found. (0x8007007E)
        TargetSite : 
            Name          : CreateResetEvent
            DeclaringType : MS.Win32.Penimc.UnsafeNativeMethods, PresentationCore, Version=7.0.0.0, 
Culture=neutral, PublicKeyToken=31bf3856ad364e35
            MemberType    : Method
            Module        : PresentationCore.dll
        Source     : PresentationCore
        HResult    : -2146233052
        StackTrace : 
   at MS.Win32.Penimc.UnsafeNativeMethods.CreateResetEvent(IntPtr& handle)
   at System.Windows.Input.PenThreadWorker..ctor()
   at System.Windows.Input.PenThreadPool.GetPenThreadForPenContextHelper(PenContext penContext)       
   at System.Windows.Input.StylusWisp.WispTabletDeviceCollection.UpdateTabletsImpl()
   at System.Windows.Input.StylusWisp.WispTabletDeviceCollection.UpdateTablets()
   at System.Windows.Input.StylusWisp.WispTabletDeviceCollection..ctor()
   at System.Windows.Input.StylusWisp.WispLogic.get_WispTabletDevices()
   at System.Windows.Input.StylusWisp.WispLogic.RegisterHwndForInput(InputManager inputManager,       
PresentationSource inputSource)
   at System.Windows.Interop.HwndStylusInputProvider..ctor(HwndSource source)
   at System.Windows.Interop.HwndSource.Initialize(HwndSourceParameters parameters)
   at System.Windows.Window.CreateSourceWindow(Boolean duringShow)
   at System.Windows.Window.ShowHelper(Object booleanBox)
   at System.Windows.Window.Show()
   at System.Windows.Window.ShowDialog()
   at CallSite.Target(Closure, CallSite, Object)
    Source         : System.Management.Automation
    HResult        : -2146233087
    StackTrace     : 
   at System.Management.Automation.ExceptionHandlingOps.ConvertToMethodInvocationException(Exception  
exception, Type typeToThrow, String methodName, Int32 numArgs, MemberInfo memberInfo)
   at CallSite.Target(Closure, CallSite, Object)
   at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
   at System.Management.Automation.Interpreter.DynamicInstruction`2.Run(InterpretedFrame frame)       
   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame   
frame)
CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
FullyQualifiedErrorId : DllNotFoundException
InvocationInfo        : 
    ScriptLineNumber : 1
    OffsetInLine     : 2
    HistoryId        : -1
    Line             :  [System.Windows.Window]::new().ShowDialog()
    PositionMessage  : At line:1 char:2
                       +  [System.Windows.Window]::new().ShowDialog()
                       +  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1

Environment data

PS> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.3.0-rc.1
PSEdition                      Core
GitCommitId                    7.3.0-rc.1
OS                             Microsoft Windows 10.0.19044
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}       
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    In-PRIndicates that a PR is out for the issueIssue-BugIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions