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.

Error BC30002 Type 'OpcLabs.EasyOpc.DataAccess.Forms.Browsing.DAItemDialog' is n

More
21 Sep 2023 08:14 #12199 by support
Hello,

I have thought a bit more about possible causes for the problem with the assembly reference.
Can you please email me your .vbproj file again (i.e. now, with QuickOPC 2023.1 being referenced as NuGet packages)?

I want to check for possibly unwanted/unnecessary assembly references that might be causing this.

Regards

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

More
21 Sep 2023 07:18 #12192 by support
Hello, thank you.

From the files you have sent, the exception occurs, because the .config file contains
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
which means that System.Runtime.CompilerServices.Unsafe assembly should be of version 5.0.0.0.

But, the actual System.Runtime.CompilerServices.Unsafe assembly in your project output is 6.0.0.0.

You need to figure out what is wrong in your project that causes this.
Give me also some time, I will investigate and think of possible causes. But ultimately, it is your task to resolve issues like this.

Regards

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

More
20 Sep 2023 14:57 #12183 by micham
Hi,

When I try running the Release I get this exception. See the attached zip file - System.Runtime.CompilerServices.Unsafe.zip.
See the attached config file.

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.InvalidOperationException: An error occurred creating the form. See Exception.InnerException for details. The error is: Could not load file or assembly 'OpcLabs.EasyOpcForms, Version=5.71.334.1, Culture=neutral, PublicKeyToken=6faddca41dacb409' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) ---> System.IO.FileLoadException: Could not load file or assembly 'OpcLabs.EasyOpcForms, Version=5.71.334.1, Culture=neutral, PublicKeyToken=6faddca41dacb409' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at EBO_Browse.OPC_Servers_Dialog.InitializeComponent()
at EBO_Browse.OPC_Servers_Dialog..ctor()
--- End of inner exception stack trace ---
at EBO_Browse.My.MyProject.MyForms.Create__Instance__[T](T Instance)
at EBO_Browse.Form1.Load_GeneralSettings()
at EBO_Browse.Form1.Form1_Load(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.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.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9181.0 built by: NET481REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
EBOOPCClientCFG
Assembly Version: 1.0.108.0
Win32 Version: 1.0.108.0
CodeBase: file:///F:/Program%20Files%20(x86)/Control-See/EBO-OPC%20client/BIN/EBOOPCClientCFG.exe
Microsoft.VisualBasic
Assembly Version: 10.0.0.0
Win32 Version: 14.8.9037.0 built by: NET481REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
System
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9172.0 built by: NET481REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9181.0 built by: NET481REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9181.0 built by: NET481REL1LAST_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.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9037.0 built by: NET481REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9037.0 built by: NET481REL1
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.9037.0 built by: NET481REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
System.Runtime.Remoting
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9037.0 built by: NET481REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
System.ServiceProcess
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9037.0 built by: NET481REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.ServiceProcess/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.ServiceProcess.dll

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.





File Attachment:

File Name: System.Run...safe.zip
File Size:9 KB

File Attachment:

File Name: EBOOPCClie...0.config
File Size:18 KB
Attachments:

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

More
20 Sep 2023 14:57 #12182 by support
Thank you. I need some more info.

1) You wrote "when I run my project in debug mode, I get this exception.". What happens if you run the Release configuration?

2) In the target folder of your debug configuration (probably bin/Debug), locate the file System.Runtime.CompilerServices.Unsafe.dll, zip it and post it here. I want to check its version.

3) In the same folder, there should be a file like <you app name>.exe.config . Please post it here. I want to check which binding redirects are in this file.

Regards

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

More
20 Sep 2023 14:47 #12181 by micham
Hi,

I have defined the components programmatically. See below. When I run my project I get the following exception.

Thank you.

Michael

Public DaItemDialog1 As OpcLabs.EasyOpc.DataAccess.Forms.Browsing.DAItemDialog
Public WithEvents EasyUAClient1 As OpcLabs.EasyOpc.UA.EasyUAClient
Public UaDataDialog1 As OpcLabs.EasyOpc.UA.Forms.Browsing.UADataDialog


System.InvalidOperationException
HResult=0x80131509
Message=An error occurred creating the form. See Exception.InnerException for details. The error is: The type initializer for 'OpcLabs.EasyOpc.Forms.Browsing.OpcDialog' threw an exception.
Source=EBOOPCClientCFG
StackTrace:
at EBO_Browse.My.MyProject.MyForms.Create__Instance__[T](T Instance) in :line 190
at EBO_Browse.My.MyProject.MyForms.get_OPC_Servers_Dialog()
at EBO_Browse.Form1.Load_GeneralSettings() in D:\MyBin\Proj-VS2017\EBO-OPC Client\Configuration(4)\Form1.vb:line 202
at EBO_Browse.Form1.Form1_Load(Object sender, EventArgs e) in D:\MyBin\Proj-VS2017\EBO-OPC Client\Configuration(4)\Form1.vb:line 76
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.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)

Inner Exception 1:
TypeInitializationException: The type initializer for 'OpcLabs.EasyOpc.Forms.Browsing.OpcDialog' threw an exception.

Inner Exception 2:
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 3:
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)

Attachments:

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

More
20 Sep 2023 13:57 #12179 by support
Regarding the missing components: The project seems to be in somehow damaged shape. It should be possible to use the Toolbox to put them back, but I am afraid we would run into even more problem. So, if you can add them from the code, it would be the easiest at the moment.

Regards

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

More
20 Sep 2023 13:52 #12178 by micham
Hi,

I see that the DA and UA components have disappeared from the form. See below.
EasyUAClient1
UaDataDialog1
DaItemDialog1

When I try to add these components from the Components Toolbox, I get an error. Should I add them programmatically?

Thank you.

Attachments:

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

More
20 Sep 2023 13:52 #12177 by support
Thank you. I need some more info.

1) You wrote "when I run my project in debug mode, I get this exception.". What happens if you run the Release configuration?

2) In the target folder of your debug configuration (probably bin/Debug), locate the file System.Runtime.CompilerServices.Unsafe.dll, zip it and post it here. I want to check its version.

3) In the same folder, there should be a file like <you app name>.exe.config . Please post it here. I want to check which binding redirects are in this file.

Regards

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

More
20 Sep 2023 13:35 #12175 by micham
Hi,

Thank you for your answer. Yes. I have it. See below.

Michael

Attachments:

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

More
20 Sep 2023 13:04 #12173 by support
Hello,

in your project properties, do you have "Auto-generate binding redirects" checked, as in the example below?



If not, check this setting, save, and rebuild.

Best regards
Attachments:

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

Moderators: support
Time to create page: 0.097 seconds