mpostol / ASMD

OPC UA Address Space Model Designer
https://mpostol.github.io/ASMD/
MIT License
58 stars 4 forks source link

NullReferenceException after opening the file\import menu before selecting the root node in the TreeView #88

Closed mpostol closed 4 years ago

mpostol commented 4 years ago

Scope

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at CAS.UA.Model.Designer.Controls.NodeObserver.ModelObserver.GetImportMenu(ToolStripItemCollection items) in C:\VS.git\ASMD\ModelDesigner.DesignStudio\Controls\NodeObserver\ModelObserver.cs:line 84
   at CAS.UA.Model.Designer.MainForm.MHFileImport_DropDownOpening(Object sender, EventArgs e) in C:\VS.git\ASMD\ModelDesigner.DesignStudio\MainForm.cs:line 255
   at System.Windows.Forms.ToolStripDropDownItem.OnDropDownShow(EventArgs e)
   at System.Windows.Forms.ToolStripDropDownItem.ShowDropDownInternal()
   at System.Windows.Forms.ToolStripMenuItem.OnMenuAutoExpand()
   at System.Windows.Forms.MenuTimer.OnTick(Object sender, EventArgs e)
   at System.Windows.Forms.Timer.OnTick(EventArgs e)
   at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4042.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
CAS.UA.ModelDesigner
    Assembly Version: 4.1.0.26653
    Win32 Version: 4.1.0
    CodeBase: file:///C:/tools/address-space-model-designer/UA.ModelDesigner/OOI.UA.ModelDesigner.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4042.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4001.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.3761.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
CAS.CommServer.UA.ConfigurationEditor.ModelsContainer
    Assembly Version: 3.20.4.26651
    Win32 Version: 3.20.4
    CodeBase: file:///C:/tools/address-space-model-designer/UA.ModelDesigner/CAS.CommServer.UA.ConfigurationEditor.ModelsContainer.DLL
----------------------------------------
System.Deployment
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.3761.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Deployment/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Deployment.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4042.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
CAS.CodeProtect
    Assembly Version: 6.1.3.22636
    Win32 Version: 6.1.3
    CodeBase: file:///C:/tools/address-space-model-designer/UA.ModelDesigner/CAS.CodeProtect.DLL
----------------------------------------
System.Configuration.Install
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.3761.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration.Install/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.Install.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.3761.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.3761.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Microsoft.Build.Tasks.Core
    Assembly Version: 14.0.0.0
    Win32 Version: 14.0.25420.1 built by: D14REL
    CodeBase: file:///C:/tools/address-space-model-designer/UA.ModelDesigner/Microsoft.Build.Tasks.Core.DLL
----------------------------------------
Microsoft.GeneratedCode
    Assembly Version: 1.0.0.0
    Win32 Version: 4.8.3761.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Data.SqlXml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.3761.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Data.SqlXml/v4.0_4.0.0.0__b77a5c561934e089/System.Data.SqlXml.dll
----------------------------------------
System.Xml.Xsl.CompiledQuery.1
    Assembly Version: 0.0.0.0
    Win32 Version: 4.8.3761.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Data.SqlXml/v4.0_4.0.0.0__b77a5c561934e089/System.Data.SqlXml.dll
----------------------------------------
System.Security
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.3761.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Security/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Security.dll
----------------------------------------
CAS.CommonResources
    Assembly Version: 2.0.6.27320
    Win32 Version: 2.00.06
    CodeBase: file:///C:/tools/address-space-model-designer/UA.ModelDesigner/CAS.CommonResources.DLL
----------------------------------------
System.Management
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.3761.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Management/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Management.dll
----------------------------------------
System.Web
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4042.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Web/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Web.dll
----------------------------------------
CAS.Windows.Forms
    Assembly Version: 6.1.2.24319
    Win32 Version: 6.1.2
    CodeBase: file:///C:/tools/address-space-model-designer/UA.ModelDesigner/CAS.Windows.Forms.DLL
----------------------------------------
CAS.CommServer.UA.ModelDesigner.ImportExport
    Assembly Version: 4.1.0.26651
    Win32 Version: 4.1.0
    CodeBase: file:///C:/tools/address-space-model-designer/UA.ModelDesigner/CAS.CommServer.UA.ModelDesigner.ImportExport.DLL
----------------------------------------
CAS.CommServer.UA.ModelDesigner.Configuration
    Assembly Version: 4.1.0.26651
    Win32 Version: 4.1.0
    CodeBase: file:///C:/tools/address-space-model-designer/UA.ModelDesigner/CAS.CommServer.UA.ModelDesigner.Configuration.DLL
----------------------------------------
CAS.RealTime.Core
    Assembly Version: 5.0.6.23643
    Win32 Version: 5.0.6
    CodeBase: file:///C:/tools/address-space-model-designer/UA.ModelDesigner/CAS.RealTime.Core.DLL
----------------------------------------
CAS.CommServer.UA.Common
    Assembly Version: 3.0.5.33238
    Win32 Version: 3.00.05
    CodeBase: file:///C:/tools/address-space-model-designer/UA.ModelDesigner/CAS.CommServer.UA.Common.DLL
----------------------------------------
CAS.UA.IServerConfiguration
    Assembly Version: 1.0.0.32204
    Win32 Version: 1.00.00
    CodeBase: file:///C:/tools/address-space-model-designer/UA.ModelDesigner/CAS.UA.IServerConfiguration.DLL
----------------------------------------
CAS.CommServer.UA.ModelCompiler.Common
    Assembly Version: 1.11.335.10
    Win32 Version: 1.11.335.10
    CodeBase: file:///C:/tools/address-space-model-designer/UA.ModelDesigner/CAS.CommServer.UA.ModelCompiler.Common.DLL
----------------------------------------
Microsoft.GeneratedCode
    Assembly Version: 1.0.0.0
    Win32 Version: 4.8.3761.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Microsoft.GeneratedCode
    Assembly Version: 1.0.0.0
    Win32 Version: 4.8.3761.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
CAS.RealTime
    Assembly Version: 5.0.6.23644
    Win32 Version: 5.0.6
    CodeBase: file:///C:/tools/address-space-model-designer/UA.ModelDesigner/CAS.RealTime.DLL
----------------------------------------
CAS.CommServer.UA.ModelDesigner.MeshDiagram3D
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0
    CodeBase: file:///C:/tools/address-space-model-designer/UA.ModelDesigner/CAS.CommServer.UA.ModelDesigner.MeshDiagram3D.DLL
----------------------------------------
PresentationFramework
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4042.0
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework/v4.0_4.0.0.0__31bf3856ad364e35/PresentationFramework.dll
----------------------------------------
WindowsBase
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4042.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/WindowsBase/v4.0_4.0.0.0__31bf3856ad364e35/WindowsBase.dll
----------------------------------------
PresentationCore
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4042.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/PresentationCore/v4.0_4.0.0.0__31bf3856ad364e35/PresentationCore.dll
----------------------------------------
System.Xaml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4042.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xaml/v4.0_4.0.0.0__b77a5c561934e089/System.Xaml.dll
----------------------------------------
WindowsFormsIntegration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.3928.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/WindowsFormsIntegration/v4.0_4.0.0.0__31bf3856ad364e35/WindowsFormsIntegration.dll
----------------------------------------
PresentationFramework.Aero2
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.3761.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework.Aero2/v4.0_4.0.0.0__31bf3856ad364e35/PresentationFramework.Aero2.dll
----------------------------------------
CAS.CommServer.UA.ModelDesigner..3DTools
    Assembly Version: 1.0.7290.26651
    Win32 Version: 1.0.7290.26651
    CodeBase: file:///C:/tools/address-space-model-designer/UA.ModelDesigner/CAS.CommServer.UA.ModelDesigner..3DTools.DLL
----------------------------------------
Microsoft.mshtml
    Assembly Version: 7.0.3300.0
    Win32 Version: 7.0.3300.0
    CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.mshtml/7.0.3300.0__b03f5f7f11d50a3a/Microsoft.mshtml.dll
mpostol commented 4 years ago

Confirmed. It is caused by opening the file\import menu before selecting the root node in the TreeView.

ImportMenuNullRefEception

mpostol commented 4 years ago

Overcome: select the root node of the TreeView before opening the File\Import menu item.

mpostol commented 4 years ago

Consider applying the following scenario: Application.ThreadException Event