Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

Exception when trying to browse OPC Servers

More
21 Sep 2023 07:35 #12196 by support
Hello.

Now the error is back to the assembly version mismatch which I have answered on the other forum thread.

We do not officially support older QuickOPC versions.

Regards

Please Log in or Create an account to join the conversation.

More
21 Sep 2023 07:08 #12191 by micham
Hi,

Thank you for your answer. I have changed the definition per your advise. When I run my project I get an exception. See below. It is the same exception all the time. Something with the follwoing:
System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0
System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1

Note: I have different versions of Quick OPC on my server.




System.TypeInitializationException
HResult=0x80131534
Message=The type initializer for 'OpcLabs.EasyOpc.Forms.Browsing.OpcDialog' threw an exception.
Source=OpcLabs.EasyOpcForms
StackTrace:
at OpcLabs.EasyOpc.Forms.Browsing.OpcDialog..ctor()
at OpcLabs.EasyOpc.Forms.Browsing.OpcComputerAndServerDialog..ctor()
at EBO_Browse.OPC_Servers_Dialog..ctor() in D:\MyBin\Proj-VS2017\EBO-OPC Client\Configuration(4)\OPC_Servers_Dialog.vb:line 34

Inner Exception 1:
FileLoadException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Inner Exception 2:
FileLoadException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)


I appreciate your help.

Michael
  • Please Log in or Create an account to join the conversation.

    More
    21 Sep 2023 06:48 #12190 by support
    Look, this is a basic programming question/mistake. But it happens...

    You are missing the "New" keyword:

    Private OpcComputerAndServerDialog1 As OpcLabs.EasyOpc.Forms.Browsing.OpcComputerAndServerDialog

    should be

    Private OpcComputerAndServerDialog1 As New OpcLabs.EasyOpc.Forms.Browsing.OpcComputerAndServerDialog

    Regards

    Please Log in or Create an account to join the conversation.

    More
    20 Sep 2023 18:33 #12185 by micham
    Hi,

    I have this variable definition:

    Private OpcComputerAndServerDialog1 As OpcLabs.EasyOpc.Forms.Browsing.OpcComputerAndServerDialog

    When I try browsing by this command:

    If OpcComputerAndServerDialog1.ShowDialog() = DialogResult.OK Then

    I get an exception:

    OpcComputerAndServerDialog1 was Nothing.

    System.NullReferenceException
    HResult=0x80004003
    Message=Object reference not set to an instance of an object.
    Source=EBOOPCClientCFG
    StackTrace:
    at EBO_Browse.OPC_Servers_Dialog.ButtonBrowseServers_Click(Object sender, EventArgs e) in D:\MyBin\Proj-VS2017\EBO-OPC Client\Configuration(4)\OPC_Servers_Dialog.vb:line 400
    at System.Windows.Forms.Control.OnClick(EventArgs e)
    at System.Windows.Forms.Button.OnClick(EventArgs e)
    at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.ButtonBase.WndProc(Message& m)
    at System.Windows.Forms.Button.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(IntPtr 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.RunDialog(Form form)
    at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
    at System.Windows.Forms.Form.ShowDialog()
    at EBO_Browse.Form1.SettingsToolStripMenuItem1_Click(Object sender, EventArgs e) in D:\MyBin\Proj-VS2017\EBO-OPC Client\Configuration(4)\Form1.vb:line 1605
    at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
    at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
    at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
    at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
    at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
    at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
    at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
    at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
    at System.Windows.Forms.ToolStrip.WndProc(Message& m)
    at System.Windows.Forms.ToolStripDropDown.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(IntPtr 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 Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
    at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
    at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
    at EBO_Browse.My.MyApplication.Main(String[] Args) in :line 81


    Any idea what is wrong?

    Thank you.

    Michael

    Please Log in or Create an account to join the conversation.

    Moderators: supportvaclav.zaloudek
    Time to create page: 0.159 seconds