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.

COMException in IIS8 / Windows Server 2012

More
18 Oct 2013 08:41 #1494 by support
Yes, in general with OPC you should never have the servers or OPCEnum set to run as "Launching user". This becomes a problem because the clients may run under different accounts, which you cannot generally control, so the behavior would differ depending on the user account of the client. In addition, when clients connect with different accounts, multiple instances of OPC servers or OPCEnum will be started - which is usually quite bad to have. "Interactive user" is not a good setting either. It should always be a pre-set, specific account, as you did.

But setting the account under which the OPC server or OPCEnum runs is just a part of the DCOM configuration. What becomes important then is the access permissions - you need to review them and add the accounts needed. And, access permissions that are set on specific COM components (OPC servers, OPC Enum) are further restricted by global DCOM "limits", that are configurable in DCOMCNFG on the machine level (right-click the computer node). Even if you allow an access to a specific account on an OPC server level, it won't work unless the DCOM "limits" also allow that account. And, sometimes, changing the DCOM security settings only takes real effect after computer restart. Terrible stuff to work with.

You can also try to assign different combinations to following static properties - in the code, before the very first OPC operation is attempted:

EasyDAClient.ClientParameters.UseCustomSecurity
EasyDAClient.ClientParameters.TurnOffActivationSecurity
EasyDAClient.ClientParameters.TurnOffCallSecurity

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

More
17 Oct 2013 08:10 #1489 by patrick
I checked the DCOM settings and i had already set the permissions for OPCEnum. The CLSID also has the right format (with the curly brackets).

In the identity tab in the properties window of the DCOM components I have set the identity to the server administrator user instead of the launching user but that did not help. I still get:

System.UnauthorizedAccessException: Access denied
ErrorCode: -2147024891

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

More
17 Oct 2013 07:18 #1487 by support
I have checked the precise meaning of the original error message, i.e.

System.Runtime.InteropServices.COMException (0xC0049039): No method available to convert ProgID to CLSID
ErrorCode: -1073442759

It is issued when there is a problem connecting to the (local, in this case) OPCEnum service (which also serves the purpose of converting ProgIDs to CLSIDs), and the ProgID cannot be converted by other means either. It looks like a security issue. When you make the DCOM settings, do not make them just for the OPC server, but also make the same for OPCEnum.

I also wanted to suggest using the CLSID directly; it is weird that it does not work. When you specify the CLSID, please make sure you put it in curly brackets, e.g. "{C8A12F17-1E03-401E-B53D-6C654DD576DA}" for our simulation server.

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

More
17 Oct 2013 05:49 #1486 by patrick
If I set the identity of the IIS AppPool to the LocalSystem account, reading from the OPC server is no problem.

So I think there is just a security setting for the IIS user which i haven't found yet.

I also replaced the name of the DCOM component with the CLSID in the ServerDescriptor constructor so that the name have not to be converted. The result was a System.UnauthorizedAccessException (access denied) (with the IIS user, with the LocalSystem account there was again no problem)

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

More
16 Oct 2013 14:34 #1485 by patrick
No, the OPC server is running on the local machine as a windows service

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

More
16 Oct 2013 13:38 #1484 by support
The error may have to do with accessing OPCEnum component.
Are you connecting to an OPC server on a remote machine?

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

More
16 Oct 2013 06:23 #1482 by patrick
Hello,

i am trying to use QuickOPC.NET in a WCF service on a Windows Server 2012 with IIS8 but i am not able to read anything from the OPC server.

While debugging i found out that the method ReadMultipleItemValues returned an error for each item:

System.Runtime.InteropServices.COMException (0xC0049039): No method available to convert ProgID to CLSID
ErrorCode: -1073442759

I have then written a simple console application which also reads the items using the ReadMultipleItemValues method.
The console application can read the values from the OPC server without any problems (the application runs under the server administrator user).

I already set the DCOM permission for the IIS user which solved the first exception (access denied). After that, the COMException occured.

Please let me know if you need any more information.
Thank you!

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

Moderators: support
Time to create page: 0.077 seconds