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.
- Forum
- Discussions
- QuickOPC-Classic in .NET
- Reading, Writing, Subscriptions, Property Access
- ReadMultipleItems - Failure: OPC NET API error - result ID: E_NETWORK_ERROR;
ReadMultipleItems - Failure: OPC NET API error - result ID: E_NETWORK_ERROR;
You have a console application right?
If so, we will try easier steps, before we proceed to using AssureSecurityInitializationAndRunOnStaThread .
I apologize for changing the approach, I have not realized all consequences upfront.
Please do this:
1. Is there an [STAThread] attribute on the program's main method?
2. If yes, remove it.
3. Put an [MTAThread] attribute on the main method.
4. Build and run the program again. Has anything changed (does it still give the error)?
5. Check the Windows Event Log. Is the same event still there?
6. If the error is still there: Add a ComManagement.Instance.AssureSecurityInitialization() call to the very beginning of the program's main method (this is an easier one - no arguments - just call it is it is).
7. Build and run the program again. Has anything changed (does it still give the error)?
8. Check the Windows Event Log. Is the same event still there?
Thank you
Please Log in or Create an account to join the conversation.
could I possibly get an example of using the AssureSecurityInitializationAndRunOnStaThread method?
I would like to hear a brief explanation of how to use it.
I'm having a hard time understanding from the content of the provided link. (opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User's...lizationAndRunOnStaThread.html)
Thank you.
Please Log in or Create an account to join the conversation.
It is important to know about this event, but it does not necessarily imply a problem. It just tells us that in the current state of things, many DCOM-related settings inside your app will be ignored, because "something" had initialized the COM security before we had a chance to do it.
I should say that this is complicated matter - and that is still an understatement.
Please read the following article to get some basic idea: kb.opclabs.com/COM_management
and have at least a brief look at kb.opclabs.com/COM_settings_in_OPC_Classic_client_components to get an idea of what we are dealing with.
I suggest to upgrade to version 2023.1, *and* encapsulate all your app code by a call to AssureSecurityInitializationAndRunOnStaThread method (opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User's...lizationAndRunOnStaThread.html ). Even if that does not directly resolve the issue, it should at least get rid of the error in the event log, allowing us to experiment with the DCOM settings from inside the application.
Best regards
Please Log in or Create an account to join the conversation.
Attachments:
Please Log in or Create an account to join the conversation.
Can you please start Windows Event Viewer, then select Event Viewer (Local) -> Windows Logs -> Application, and check if there are events around the time the program was started and the first time the error occurred afterwards? If there are such events, please post them here.
Thank you
Please Log in or Create an account to join the conversation.
I will update the version to the latest one, 5.7.1.
Here are the answers to your questions:
1. I will check on that.
2. There were no changes to the source code, only the version mentioned below was updated.
3. It is a WPF project.
4. I am targeting .NET Framework.
5. I'm using the EnableNativeClient = false setting because when I had an issue with remote connection in the past and asked about it, I was advised to try this setting. Once I did, the remote connection was established, so I've continued to use this setting.
Please Log in or Create an account to join the conversation.
Yes, this is almost certainly related to DCOM security.
I have earlier suggested an update to a current version (which is now 5.71). Please do it at the first opportunity, because we cannot reliably support older versions.
I have some additional questions:
1. Which operating system is running on the client and server side? Could they be affected by support.microsoft.com/en-us/topic/kb5004442-manage-changes-f...52-c141-43d2-941e-37ed901c769c ?
2. Has it been working before, and only stopped working at some date? Or was the only difference the version change you mentioned?
3. What type of project are you building in VS? Such as Console app, Windows Forms app, Windows service, Web service, etc.?
4. Are you targeting .NET Framework or .NET Core/.NET 6+?
5. Is there a specific reason for having the EnableNativeClient = false setting?
Best regards
Please Log in or Create an account to join the conversation.
Attachments:
Please Log in or Create an account to join the conversation.
I can't test it because I withdrew from the site. We will test later and contact you again.
Best regards
Please Log in or Create an account to join the conversation.
I need some additional information:
1. The [...] in the error message indicates that are are more lines to the message. Please get the full message (Message property of the Exception object in the result object). And, and if there is .InnerException inside that exception, also the Message of that InnerException, and so forth.
2. 5.63.246 is not the current version. The current version is 5.70. Please test with it and report what the results are.
Best regards
Please Log in or Create an account to join the conversation.
- Forum
- Discussions
- QuickOPC-Classic in .NET
- Reading, Writing, Subscriptions, Property Access
- ReadMultipleItems - Failure: OPC NET API error - result ID: E_NETWORK_ERROR;