The property 'DpiChanged' doesn't exist on System.Windows.Window
还没有人认领这个 Issue。
评估
调研方向
从 ICSharpCode.WpfDesign.XamlDom.XamlObject.FindOrCreateProperty 开始,沿着堆栈跟踪中描述的 PropertyGrid.Reload 调用路径进行跟踪。复现所报告的 WPF 设计器场景,并确认缺少 DpiChanged 属性不再导致工作台终止。
由索引模型根据 Issue 内容生成。
描述
Hi,
I am using SD in an Autodesk software called Revit, and I am experiencing this error:
SharpDevelop Version : 4.2.0.8783-27231549
.NET Version : 4.0.30319.42000
OS Version : Microsoft Windows NT 6.2.9200.0
Current culture : Invariant Language (Invariant Country) ()
Current UI language : en
Running as 64 bit process
Working Set Memory : 389192kb
GC Heap Memory : 195512kb
Unhandled exception terminated the workbench
Exception thrown:
System.ArgumentException: The property 'DpiChanged' doesn't exist on System.Windows.Window
Parameter name: propertyName
at ICSharpCode.WpfDesign.XamlDom.XamlObject.FindOrCreateProperty(String propertyName)
at ICSharpCode.WpfDesign.Designer.Xaml.XamlModelPropertyCollection.GetProperty(String name)
at ICSharpCode.WpfDesign.Designer.PropertyGrid.PropertyGrid.<>c__DisplayClass4.b__3(DesignItem item)
at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext()
at System.Linq.Buffer1..ctor(IEnumerable1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)
at ICSharpCode.WpfDesign.Designer.PropertyGrid.PropertyGrid.AddNode(MemberDescriptor md)
at ICSharpCode.WpfDesign.Designer.PropertyGrid.PropertyGrid.Reload()
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at ICSharpCode.SharpDevelop.Commands.WorkbenchStartup.Run(IList`1 fileList)
at ICSharpCode.SharpDevelop.Sda.CallHelper.RunWorkbenchInternal(Object settings)
---- Recent log messages:
09:06:53.857 [19] DEBUG - Removing part C:\ProgramData\Autodesk\Revit\Macros\2023\Revit\AppHookup\WPFs\Source\WPFs\Window1.xaml from compound class WPFs.Window1
09:06:53.857 [19] DEBUG - Second-to-last part removed (old part count = 2), overwriting compound with last part
09:06:53.857 [19] DEBUG - Adding existing class Window1 from Window1.xaml
09:06:53.857 [19] DEBUG - Creating compound for WPFs.Window1
09:06:53.858 [SDmain] DEBUG - ParseInformationUpdated C:\ProgramData\Autodesk\Revit\Macros\2023\Revit\AppHookup\WPFs\Source\WPFs\Window1.xaml new!=null:True
09:06:54.638 [SDmain] DEBUG - Removing part C:\ProgramData\Autodesk\Revit\Macros\2023\Revit\AppHookup\WPFs\Source\WPFs\Window1.xaml from compound class WPFs.Window1
09:06:54.638 [SDmain] DEBUG - Second-to-last part removed (old part count = 2), overwriting compound with last part
09:06:54.638 [SDmain] DEBUG - Adding existing class Window1 from Window1.xaml
09:06:54.638 [SDmain] DEBUG - Creating compound for WPFs.Window1
09:06:54.639 [SDmain] DEBUG - Removing part C:\ProgramData\Autodesk\Revit\Macros\2023\Revit\AppHookup\WPFs\Source\WPFs\Window1.xaml from compound class WPFs.Window1
09:06:54.639 [SDmain] DEBUG - Second-to-last part removed (old part count = 2), overwriting compound with last part
09:06:54.639 [SDmain] DEBUG - Adding existing class Window1 from Window1.xaml
09:06:54.639 [SDmain] DEBUG - Creating compound for WPFs.Window1
09:06:54.680 [SDmain] DEBUG - TypeResolutionService: AssemblyResolveEventHandler: ICSharpCode.WpfDesign.AddIn.resources, Version=4.2.0.8783, Culture=en, PublicKeyToken=null
09:06:54.680 [SDmain] DEBUG - TypeResolutionService: AssemblyResolveEventHandler: ICSharpCode.WpfDesign.AddIn.resources, Version=4.2.0.8783, Culture=en, PublicKeyToken=null
09:06:54.687 [SDmain] DEBUG - TypeResolutionService: AssemblyResolveEventHandler: ICSharpCode.WpfDesign.resources, Version=4.2.0.8783, Culture=en, PublicKeyToken=f829da5c02be14ee
09:06:54.687 [SDmain] DEBUG - TypeResolutionService: AssemblyResolveEventHandler: ICSharpCode.WpfDesign.resources, Version=4.2.0.8783, Culture=en, PublicKeyToken=f829da5c02be14ee
09:06:54.816 [SDmain] INFO - Unloading services...
09:06:54.816 [SDmain] INFO - CurrentProject changed to null
09:06:54.821 [SDmain] DEBUG - Removing part C:\ProgramData\Autodesk\Revit\Macros\2023\Revit\AppHookup\WPFs\Source\WPFs\ThisApplication.cs from compound class WPFs.ThisApplication
09:06:54.821 [SDmain] DEBUG - Second-to-last part removed (old part count = 2), overwriting compound with last part
09:06:54.821 [SDmain] DEBUG - Removing part C:\ProgramData\Autodesk\Revit\Macros\2023\Revit\AppHookup\WPFs\Source\WPFs\Window1.xaml from compound class WPFs.Window1
09:06:54.821 [SDmain] DEBUG - Second-to-last part removed (old part count = 2), overwriting compound with last part
09:06:54.859 [SDmain] INFO - Finished running workbench.
09:06:54.860 [SDmain] FATAL - System.ArgumentException: The property 'DpiChanged' doesn't exist on System.Windows.Window
Parameter name: propertyName
at ICSharpCode.WpfDesign.XamlDom.XamlObject.FindOrCreateProperty(String propertyName)
at ICSharpCode.WpfDesign.Designer.Xaml.XamlModelPropertyCollection.GetProperty(String name)
at ICSharpCode.WpfDesign.Designer.PropertyGrid.PropertyGrid.<>c__DisplayClass4.b__3(DesignItem item)
at System.Linq.Enumerable.WhereSelectArrayIterator2.MoveNext()
at System.Linq.Buffer1..ctor(IEnumerable1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)
at ICSharpCode.WpfDesign.Designer.PropertyGrid.PropertyGrid.AddNode(MemberDescriptor md)
at ICSharpCode.WpfDesign.Designer.PropertyGrid.PropertyGrid.Reload()
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at ICSharpCode.SharpDevelop.Commands.WorkbenchStartup.Run(IList`1 fileList)
at ICSharpCode.SharpDevelop.Sda.CallHelper.RunWorkbenchInternal(Object settings)
---- Post-error application state information:
Installed 3rd party AddIns: [SharpDevelop 4.2.0.8783], [CodeAnalysis 0.0.0.0], [SourceAnalysis 0.0.0.0], [Unit Testing Addin 0.0.0.0], [C# Binding 0.0.0.0], [Python Binding 0.0.0.0], [Ruby Binding 0.0.0.0], [VB .NET Binding 0.0.0.0], [XAML binding 0.0.0.0], [Debugger 0.0.0.0], [AvalonEdit.AddIn 0.0.0.0], [Class Diagram 0.0.0.0], [Data Addin 0.0.0.0], [ILSpyAddIn 0.0.0.0], [Forms Designer 0.0.0.0], [HexEditor 0.0.0.0], [IconViewerAddIn 0.0.0.0], [Resource Editor 0.0.0.0], [WPF Designer AddIn 0.0.0.0], [XML Editor 0.0.0.0], [AddInManager 0.0.0.0], [Microsoft Help System v1.0], [PInvoke Add-in 0.0.0.0], [Regular expressions toolkit 0.0.0.0], [Hornung.ResourceToolkit 0.0.0.0], [Search & Replace 0.0.0.0], [SharpRefactoring 0.0.0.0]
ProjectService.OpenSolution:
ProjectService.CurrentProject:
Regards,
- 主要语言
- C#
- 星标
- 1.1k
- 派生
- 281
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
icsharpcode/WpfDesigner 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 35/100
icsharpcode/WpfDesigner#121 ·
-
难度 4/5 3-5 天 新手友好度 35/100
icsharpcode/WpfDesigner#101 ·
-
难度 3/5 1-2 天 新手友好度 35/100
icsharpcode/WpfDesigner#92 ·
-
难度 5/5 一周以上 新手友好度 25/100
icsharpcode/WpfDesigner#81 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 25/100
icsharpcode/WpfDesigner#72 · 3 条评论 ·
查看 icsharpcode/WpfDesigner 的全部 Issue
相似的 Issue
-
type:task ux
难度 2/5 1-3 小时 新手友好度 72/100
elsa-workflows/elsa-foundation#5253 ·
维护者通常 1 天内回复