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.

Could not load file or assembly 'OpcNetApi, Version=5.53.405.1

More
31 Dec 2018 11:12 - 31 Dec 2018 11:12 #6944 by support
There isn't anything related to QuickOPC in the call stack, so QuickOPC isn't really involved in this error directly.

What us probably happening is that the software you are using is trying to load various assemblies, including QuickOPC (not sure why - that's probably not what it should be doing anyway), and in the process, it (also incorrectly) assumes that all dependant assemblies must be directly be loadable from the disk as well .

OpcNetApi is one of the dependant assemblies, and in order to reduce the amount of files needed with QuickOPC, it is not normally deployed as a separate assembly. It is embedded inside as a managed resource, and QuickOPC loads it when it needs it.

For possible workaround, deploy the dependant ("embedded") assemblies as separate files as well. See the bottom of this documentation article: opclabs.doc-that.com/files/onlinedocs/QuickOpc/2018.2/User%2...webframe.html#Assemblies2.html .

Best regards
Last edit: 31 Dec 2018 11:12 by support.

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

More
31 Dec 2018 09:54 - 31 Dec 2018 10:38 #6943 by usmanshahid
I have a console application that uses EasyOpcClassic version 2018.2 5.53.405.1 for fetching OPC Alarms. I also use Avro Ipc version 1.8.3 (0.9.0.0) to perform some RPC calls to another server. When used together, this exception is thrown:
{"Could not load file or assembly 'OpcNetApi, Version=5.53.405.1, Culture=neutral, PublicKeyToken=6faddca41dacb409' or one of its dependencies. The system cannot find the file specified.":"OpcNetApi, Version=5.53.405.1, Culture=neutral, PublicKeyToken=6faddca41dacb409"}
{"Could not load file or assembly 'OpcNetApi, Version=5.53.405.1, Culture=neutral, PublicKeyToken=6faddca41dacb409' or one of its dependencies. The system cannot find the file specified.":"OpcNetApi, Version=5.53.405.1, Culture=neutral, PublicKeyToken=6faddca41dacb409"}
{"Could not load file or assembly 'OpcNetApi, Version=5.53.405.1, Culture=neutral, PublicKeyToken=6faddca41dacb409' or one of its dependencies. The system cannot find the file specified.":"OpcNetApi, Version=5.53.405.1, Culture=neutral, PublicKeyToken=6faddca41dacb409"}

The stacktrace is:
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.RuntimeModule.GetTypes()
   at System.Reflection.Assembly.GetTypes()
   at Avro.Specific.ObjectCreator.FindType(String name, Boolean throwError)
   at Avro.Specific.ObjectCreator.GetType(String name, Type schemaType)
   at Avro.Specific.ObjectCreator.New(String name, Type schemaType)
   at Avro.Specific.SpecificDefaultReader.ReadRecord(Object reuse, RecordSchema writerSchema, Schema readerSchema, Decoder dec)
   at Avro.Generic.DefaultReader.Read(Object reuse, Schema writerSchema, Schema readerSchema, Decoder d)
   at Avro.Generic.DefaultReader.Read[T](T reuse, Decoder decoder)
   at Avro.ipc.Requestor.ReadHandshake(BinaryDecoder input)
   at Avro.ipc.Requestor.TransceiverCallback`1.HandleResult(IList`1 result)
   at Avro.ipc.Transceiver.Transceive(IList`1 request, ICallback`1 callback)
   at Avro.ipc.Requestor.Request[T](RpcRequest request, ICallback`1 callback)
   at Avro.ipc.Requestor.Request(String messageName, Object request)
   at Avro.ipc.Specific.SpecificRequestor.Intercept(IInvocation invocation)
   at Castle.DynamicProxy.AbstractInvocation.Proceed()
   at Castle.Proxies.AvroProtocolCallbackProxy.getData()
   at MyApp.Core.Licensing.AvroManager.<>c__DisplayClass19_0.<.ctor>b__0(Object s)
   at System.Threading.TimerQueueTimer.CallCallbackInContext(Object state)
   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.TimerQueueTimer.CallCallback()
   at System.Threading.TimerQueueTimer.Fire()
   at System.Threading.TimerQueue.FireNextTimers()
   at System.Threading.TimerQueue.AppDomainTimerCallback()

More specifically, it happens when I call `Castle.Proxies.AvroProtocolCallbackProxy.getData()`.
Also, the code runs perfectly fine if I do not perform the above call. The call is an RPC request from an Avro client to an Avro Server.

The project uses .NET framework 4.6.1.
The strange bit is that Avro Ipc is unrelated to OPC, and I don't think QuickOpc packs OpcNetApi with itself.

Under the hood I can see that the assembly.GetTypes() call is being done on the assembly:
{OpcLabs.EasyOpcClassic, Version=5.53.405.1, Culture=neutral, PublicKeyToken=6faddca41dacb409}

And this is throwing the TypeLoadException
Last edit: 31 Dec 2018 10:38 by usmanshahid.

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

Moderators: support
Time to create page: 0.045 seconds