why is my implementation crahsing

SyntaxEditor for Windows Forms Forum

Posted 12 years ago by Leif Zars
Avatar
why is my implementation crashing

when ever i remove then try to add the "()" after the statement "components.Dispose()" the following is the exception info.

Object reference not set to an instance of an object.

at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.DotNetProjectResolver.GetMember(IDomType contextType, IDomType targetType, String name, DomBindingFlags flags)
at ActiproSoftware.SyntaxEditor.Addons.VB.VBContext.a(Document A_0, CompilationUnit A_1, DotNetProjectResolver A_2)
at ActiproSoftware.SyntaxEditor.Addons.VB.VBContext.GetContextBeforeOffset(Document document, Int32 offset, CompilationUnit compilationUnit, DotNetProjectResolver projectResolver, Boolean forParameterInfo)
at ActiproSoftware.SyntaxEditor.Addons.VB.VBSyntaxLanguage.GetContext(SyntaxEditor syntaxEditor, Int32 offset, Boolean beforeOffset, Boolean forParameterInfo)
at ActiproSoftware.SyntaxEditor.Addons.DotNet.Dom.DotNetSyntaxLanguage.a(DotNetLanguage A_0, SyntaxEditor A_1, Int32 A_2, Boolean A_3)
at ActiproSoftware.SyntaxEditor.Addons.VB.VBSyntaxLanguage.OnSyntaxEditorKeyTyped(SyntaxEditor syntaxEditor, KeyTypedEventArgs e)
at ActiproSoftware.SyntaxEditor.SyntaxEditor.a(EditorView A_0, Keys A_1, Char A_2, Boolean A_3)
at ActiproSoftware.SyntaxEditor.SyntaxEditor.OnKeyPress(KeyPressEventArgs e)
at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
at System.Windows.Forms.Control.WmKeyChar(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at ActiproSoftware.SyntaxEditor.SyntaxEditor.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)


The following full body of code must be put in the editor for the exception to be thrown.


Option Strict Off
Option Explicit On

Imports System
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Drawing

Partial Class NewItem
Inherits DevExpress.XtraEditors.XtraForm

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
components = New System.ComponentModel.Container
Me.Text = "NewItem"
End Sub
End Class


the exception is not thrown in your demo app only my app, any thoughts on what might be wrong with my implementation.

Thanks
Leif Zars

Comments (3)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
It's difficult to say what could be happening without being able to debug it. First are you sure you have the latest maintenance release? Also, did you configure the cache and everything correctly like we do in the .NET reflection quickstart and as mentioned in the documentation?

If you ensure that the setup is correct, then please create a simple project that repros it and email it over so we can debug. Thanks!


Actipro Software Support

Posted 12 years ago by Leif Zars
Avatar
so i figured it out when i only have some of the assemblies loaded via AddExternalReferenceForSystemAssembly

System.Windows.Forms
System
System.Drawing
DevExpress.Data.v7.2
DevExpress.Utils.v7.2
DevExpress.XtraEditors.v7.2
BCAM.CCE
BCAM.GeneralCore
BCAM.CCE.Data
BCAM.Module

and do the above it crashes
but when i load all of the assemblies referenced by my project it works fine
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Unfortunately we really would need a tiny sample project that shows this happening so we can debug it. It's hard to say without seeing where it's breaking down in the code.


Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 9 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.