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.

[5.71.273] Stop referencing Microsoft.Net.Http for net6.0 target

More
26 Jul 2023 17:37 #11958 by support
Hello,
thank you very much for the call stacks. It has helped a lot.

We have made a fix that should address at least the "internal error" issues. Whether or not it will also resolve the slowness with unreachable PLC needs to be tested.

Please rebuild with QuickOPC 5.71.302 or later, and retest. It is now on www.nuget.org and on our Downloads page.

Best regards

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

More
25 Jul 2023 08:09 #11949 by boppbo
The Stacktrace on the exception itself had one more entry

at System.Threading.Monitor.Exit(Object obj)
at OpcLabs.EasyOpc.UA.Toolkit.Client.UASessionConverter.ExitSdkNamespaceUris()

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

More
25 Jul 2023 08:06 #11948 by boppbo

Hello.
Please create a new forum thread next time (and possibly link to the original one) in such case, as we are now on to a different issue.

I am quite interested in resolving this. The three messages you posted are triggered by one or two causes. The "internal error" should never happen, no matter what your code does or what the downstream OPC systems do. I have some questions:

1. What kind of project do you have (such as Windows WPF app, Windows services, Web app, Web service, console app, etc.)?
WPF, using only the imperative parts of quickopc

2. The messages below are now taken from version 5.71, right? - please confirm.
Yes, nuget.org 5.71.296

3. Do you perhaps have a self-contained reproducible scenario that we can run here?
I fear not, sorry. But I noticed a significant speed up and no more Unavailable-Session-Log-Entries after removing our "Unreachable-PLC"-Subscription. I can't do this workaround in production as it is expected that sometimes we loose connection to our PLCs

4. If not, can you configure the debugger to break when exception of type System.Threading.SynchronizationLockException is thrown, and obtain a call stack and post it here?

Sure!
OpcLabs.EasyOpcUA.dll!OpcLabs.EasyOpc.UA.Toolkit.Client.UASessionConverter.ExitSdkNamespaceUris()
OpcLabs.EasyOpcUA.dll!OpcLabs.EasyOpc.UA.Toolkit.UAConverter.PerformWithSdkNamespaceUris(System.Func<Opc.Ua.StringTable, System.Exception> function)
OpcLabs.EasyOpcUA.dll!OpcLabs.EasyOpc.UA.Toolkit.UAConverter.ConvertToNodeId(Opc.Ua.ExpandedNodeId sdkExpandedNodeId, out OpcLabs.EasyOpc.UA.AddressSpace.UANodeId nodeId = null)
OpcLabs.EasyOpcUA.dll!OpcLabs.EasyOpc.UA.Toolkit.UAConverter.ConvertToExtensionObject(Opc.Ua.ExtensionObject sdkExtensionObject = {Opc.Ua.ExtensionObject}, out OpcLabs.EasyOpc.UA.UAExtensionObject extensionObject = null)
OpcLabs.EasyOpcUA.dll!OpcLabs.EasyOpc.UA.Toolkit.UAConverter.MakeValueFromSdkExtensionObject(Opc.Ua.ExtensionObject sdkExtensionObject, out object value = null, out System.Collections.Generic.List<System.Exception> warnings)
OpcLabs.EasyOpcUA.dll!OpcLabs.EasyOpc.UA.Toolkit.UAConverter.ConvertSdkValue(object sdkValue, Opc.Ua.BuiltInType sdkBuiltInType, OpcLabs.EasyOpc.UA.UAAttributeId attributeId, out object value, out System.Collections.Generic.List<System.Exception> warnings)
OpcLabs.EasyOpcUA.dll!OpcLabs.EasyOpc.UA.Toolkit.UAConverter.ConvertAndCheckSdkValue(object sdkValue, Opc.Ua.BuiltInType sdkBuiltInType, OpcLabs.EasyOpc.UA.UAAttributeId attributeId, out object value = null, out System.Collections.Generic.List<System.Exception> warnings = Count = 0)
OpcLabs.EasyOpcUA.dll!OpcLabs.EasyOpc.UA.Toolkit.UAConverter.MakeValueFromSdkVariant(Opc.Ua.Variant sdkVariant, OpcLabs.EasyOpc.UA.UAAttributeId attributeId, out object value = null, out System.Collections.Generic.List<System.Exception> warnings)
OpcLabs.EasyOpcUA.dll!OpcLabs.EasyOpc.UA.Toolkit.UAConverter.MakeDataValue(Opc.Ua.DataValue sdkDataValue = {Opc.Ua.DataValue}, Opc.Ua.TimestampsToReturn sdkTimestampsExpected = Both, OpcLabs.EasyOpc.UA.UAAttributeId attributeId, out OpcLabs.EasyOpc.UA.UADataValue dataValue = null, out System.Collections.Generic.List<System.Exception> warnings = Count = 0)
OpcLabs.EasyOpcUA.dll!OpcLabs.EasyOpc.UA.Toolkit.UAConverter.MakeAttributeData(Opc.Ua.DataValue sdkDataValue, Opc.Ua.TimestampsToReturn sdkTimestampsExpected, OpcLabs.EasyOpc.UA.UAAttributeId attributeId, out OpcLabs.EasyOpc.UA.UAAttributeData attributeData = null, out System.Collections.Generic.List<System.Exception> warnings)
OpcLabs.EasyOpcUA.dll!OpcLabs.EasyOpc.UA.Toolkit.Client.UAClientMonitoredItem.SendDataChangeNotification(System.Exception exception = null, Opc.Ua.MonitoredItemNotification sdkMonitoredItemNotification = {Opc.Ua.MonitoredItemNotification})
OpcLabs.EasyOpcUA.dll!OpcLabs.EasyOpc.UA.Toolkit.Client.UAClientMonitoredItem.OnSdkNotification(Opc.Ua.Client.MonitoredItem sdkMonitoredItem = {Opc.Ua.Client.MonitoredItem}, Opc.Ua.Client.MonitoredItemNotificationEventArgs sdkMonitoredItemNotificationEventArgs = {Opc.Ua.Client.MonitoredItemNotificationEventArgs})
OpcLabs.EasyOpcUA.dll!OpcLabs.EasyOpc.UA.Toolkit.Client.UAClientMonitoredItemBase.MonitoredItem_Notification.AnonymousMethod__0()
OpcLabs.EasyOpcUA.dll!OpcLabs.EasyOpc.UA.Toolkit.UAEngineBase.SdkCallbackEnvelope(System.Func<System.IDisposable> usingFunction, string name = "MonitoredItem.Notification", System.Action callback)
OpcLabs.EasyOpcUA.dll!OpcLabs.EasyOpc.UA.Toolkit.Client.UAClientMonitoredItemBase.MonitoredItem_Notification(Opc.Ua.Client.MonitoredItem sdkMonitoredItem = {Opc.Ua.Client.MonitoredItem}, Opc.Ua.Client.MonitoredItemNotificationEventArgs sdkMonitoredItemNotificationEventArgs = {Opc.Ua.Client.MonitoredItemNotificationEventArgs})
Opc.Ua.Client.dll!Opc.Ua.Client.MonitoredItem.SaveValueInCache(Opc.Ua.IEncodeable newValue)
Opc.Ua.Client.dll!Opc.Ua.Client.Subscription.SaveDataChange(Opc.Ua.NotificationMessage message = {Opc.Ua.NotificationMessage}, Opc.Ua.DataChangeNotification notifications = {Opc.Ua.DataChangeNotification}, System.Collections.Generic.IList<string> stringTable = Count = 0)
Opc.Ua.Client.dll!Opc.Ua.Client.Subscription.OnMessageReceived()
System.Private.CoreLib.dll!System.Threading.Tasks.Task<System.Threading.Tasks.Task>.InnerInvoke()
System.Private.CoreLib.dll!System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(System.Threading.Thread threadPoolThread = {System.Threading.Thread}, System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state)
System.Private.CoreLib.dll!System.Threading.Tasks.Task.ExecuteWithThreadLocal(ref System.Threading.Tasks.Task currentTaskSlot = Id = 5580, Status = Running, Method = "System.Threading.Tasks.Task OnMessageReceived()", Result = "{Not yet computed}", System.Threading.Thread threadPoolThread)
System.Private.CoreLib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch()
System.Private.CoreLib.dll!System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()

Many thanks
Thanks for your fast responses, even during your holiday! :)

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

More
25 Jul 2023 07:13 #11947 by support
Hello.
Please create a new forum thread next time (and possibly link to the original one) in such case, as we are now on to a different issue.

I am quite interested in resolving this. The three messages you posted are triggered by one or two causes. The "internal error" should never happen, no matter what your code does or what the downstream OPC systems do. I have some questions:

1. What kind of project do you have (such as Windows WPF app, Windows services, Web app, Web service, console app, etc.)?

2. The messages below are now taken from version 5.71, right? - please confirm.

3. Do you perhaps have a self-contained reproducible scenario that we can run here?

4. If not, can you configure the debugger to break when exception of type System.Threading.SynchronizationLockException is thrown, and obtain a call stack and post it here?

Many thanks

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

More
24 Jul 2023 10:45 #11946 by boppbo
Thanks for the fix. I can confirm, that the new version doesn't references these packages anymore.

Unfortunately I can't upgrade yet, as versions newer than 5.62.1032 cause my app to be really slow, as soon as there is a subscription to an unreachable plc. Sadly there isn't much useful in the logs. The first log message appears periodically and seems most related. Using Isolated clients or setting SynchronizationContext to null didn't help. I'm using dotnet 7.0

OpcLabs.EasyOpc.UA.Engine.UAEngineException: Timed out waiting (2000 milliseconds) for a session to become available for a conversion.
+ The client method called (or event/callback invoked) was 'DataChangeNotification'.
+ Total internal error(s): 1, total internal warning(s): 0
OpcLabs.Reflection.AssemblyLoading Error: 0 : Assembly "OpcLabs.BaseLib.resources, Version=5.71.296.1, Culture=de-DE, PublicKeyToken=6faddca41dacb409" extended load requested by "OpcLabs.BaseLib, Version=5.71.296.1, Culture=neutral, PublicKeyToken=6faddca41dacb409" failed, exception: System.ArgumentException: An item with the same key has already been added. Key: PresentationFramework-SystemXmlLinq, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at OpcLabs.BaseLib.Collections.Generic.Extensions.IDictionaryExtension.AddWithCheck[TKey,TValue](IDictionary`2 dictionary, TKey key, TValue value)
   at OpcLabs.BaseLib.Collections.Generic.Extensions.IDictionaryExtension.AddNew[TKey,TValue](IDictionary`2 dictionary, TKey key, TValue value)
   at OpcLabs.BaseLib.Collections.Generic.Extensions.IDictionaryExtension.TryAddNew[TKey,TValue](IDictionary`2 dictionary, TKey key, TValue value)
   at OpcLabs.BaseLib.Reflection.AssemblyLoader.LoadByFallbackSearch(AssemblyName assemblyName, Assembly requestingAssembly)
   at OpcLabs.BaseLib.Reflection.AssemblyLoader.InternalLoad(String name, Assembly requestingAssembly)
   at OpcLabs.BaseLib.Reflection.AssemblyLoader.LoadExtended(String name, Assembly requestingAssembly)
Exception thrown: 'System.Threading.SynchronizationLockException' in OpcLabs.EasyOpcUA.dll
OpcLabs.EventTracing.LogEntries Error: 1 : LogEntry("OPCLabs-UAEngine",Error,0,1). INTERNAL ERROR. The OPC-UA engine might be in an unstable state.    An exception of type "System.Threading.SynchronizationLockException" from source "System.Private.CoreLib" has occurred in OPC-UA SDK callback 'MonitoredItem.Notification'. The exception descend follows. (0) System.Threading.SynchronizationLockException System.Private.CoreLib (Exit) -> Object synchronization method was called from an unsynchronized block of code. 
OpcLabs.EasyOpc.UA.EasyUAClient: Trace: OPC Log: Error(1): INTERNAL ERROR. The OPC-UA engine might be in an unstable state. 
  An exception of type "System.Threading.SynchronizationLockException" from source "System.Private.CoreLib" has occurred in OPC-UA SDK callback 'MonitoredItem.Notification'. The exception descend follows.
(0) System.Threading.SynchronizationLockException System.Private.CoreLib (Exit) -> Object synchronization method was called from an unsynchronized block of code.
 
Exception thrown: 'System.Security.SecurityException' in Microsoft.Win32.Registry.dll
Exception thrown: 'System.Security.SecurityException' in System.Diagnostics.EventLog.dll
OpcLabs.EasyOpc.UA.UAEngineBase Critical: 0 : Exception "System.Security.SecurityException: The source was not found, but some or all event logs could not be searched.  To create the source, you need permission to read all event logs to make sure that the new source name is unique.  Inaccessible logs: Security.
   at System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly, Boolean wantToCreate)
   at System.Diagnostics.EventLog.SourceExists(String source, String machineName, Boolean wantToCreate)
   at System.Diagnostics.EventLogInternal.VerifyAndCreateSource(String sourceName, String currentMachineName)
   at System.Diagnostics.EventLogInternal.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData)
   at System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData)
   at System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type)
   at OpcLabs.BaseLib.Diagnostics.Utilities.EventLogUtilities.TryWriteEntry(String source, String message, EventLogEntryType type)" writing an internal error or warning to the event log: An exception of type "System.Threading.SynchronizationLockException" from source "System.Private.CoreLib" has occurred in OPC-UA SDK callback 'MonitoredItem.Notification'. The exception descend follows.
(0) System.Threading.SynchronizationLockException System.Private.CoreLib (Exit) -> Object synchronization method was called from an unsynchronized block of code.

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

More
23 Jul 2023 14:20 #11945 by support
Hello,

the issue should now be fixed. Please use QuickOPC 5.71.296 (or later). It is now on www.nuget.org, and on Downloads page on our Web site.
The package reference to Microsoft.Net.Http has been removed from the .nuspec as unnecessary/unused .

Thank you for reporting this!

Best regards

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

More
11 Jul 2023 17:35 #11899 by support
Yes indeed, you are right, Microsoft.Net.Http is in our nuspec for net6.0 (Microsoft.Bcl isn't). I have overlooked that somehow.

I will investigate why is that and how it can be rectified; but please bear with me, I am travelling now and we will be able to work on this in roughly 2 weeks. I will reply here when I have an update.

Best regards

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

More
11 Jul 2023 13:50 #11898 by boppbo

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

More
11 Jul 2023 12:14 #11896 by support
Hello.

As far as I can tell, we do not directly reference Microsoft.Bcl or Microsoft.Net.Http in QuickOPC 5.71 anywhere. It is possible that some dependent package references them, but in such case, we cannot prevent it. Also, as far as I can tell, the warnings are harmless.

If you have an information to the contrary to what as I wrote above, please let me know.

Best regards

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

More
10 Jul 2023 09:46 #11894 by boppbo
"This package is not supported in Visual Studio 2010, and is only required for projects targeting .NET Framework 4.5, Windows 8, or Windows Phone 8.1 when consuming a library that uses this package."

Causes:
warning NU1701: Package 'Microsoft.Bcl 1.1.10' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net7.0'. This package may not be fully compatible with your project.
warning NU1701: Package 'Microsoft.Net.Http 2.2.29' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net7.0'. This package may not be fully compatible with your project.

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

Moderators: support
Time to create page: 0.090 seconds