C # OPC Automation gives 80040154

I am a .Net developer. New for OPC. When I tried several samples of OPC Client, they all throw this error. The dll seems to not be registered. But I do not know how and where to register it.

error: retrieving the COM class factory for component with CLSID failed due to the following error: 80040154 

Even i tried this

 regsvr32 Interop.OPCAutomation.dll", 

but also causes an error, for example

 The module "Interop.OPCAutomation.dll" was loaded but the entry-point DllRegisterServeer was not found. Make sure that "Interop.OPCAutomation.dll" is a valid DLL or OCX file and then try again. 

I went through many existing forums. Many of them said to change the Target platform to x86, and yet I have the same problem. FYI, I see only the "Active (any processor)" view in the "Platform" option at the top of the "Assembly" tab of the project properties.

Here are the details of my environment:

 .Net 2005 OPCAutomation Weapper Windows 7 64-bit OS Dell Inspiron 1525 (I hope this is not a 64bit machine, but my engineer installed 64bit OS somehow). 

Please help me.

Thanks in advance!

+4
source share
6 answers

Just in case, someone is dealing with this problem (since I was recently ...), I went through this! After a while I found out that this is something about the .NET platform running on 64-bit machines. While the .NET application only works with the 32-bit CLR, we must install the .NET platform to load the CLR in WOW mode. To do this, enter:

 C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Ldr64.exe SetWow 

After that you will be able to launch applications.

You can go back and return the .NET Framework as before by typing:

 C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Ldr64.exe Set64 
+5
source

If you are using the OPC Client Toolkit SDK (C ++), a problem with the remote registry service may also cause this error.

In Windows 7, by default, the Remote Registry service is installed manually and is not running. Verify that the remote registry service is running on all the machines for which you want to deploy. This can be done manually or using Group Policy.

The GetCLSIDFromRemoteRegistry () function uses the RemoteRegistryService to obtain the CLSID of the OPC server. If this service is not running on the client computer, the OPC program may return error 80040154.

+1
source

The error you get is more than likely due to incorrect registration of the OPC server. Make sure it is registered (usually by running it on the command line with the "/ regserver" or "/ service" option). There may also be security issues, in which case you will need to run "dcomcnfg" (DCOM Config) to make sure that the client has access to the server.

0
source

This question is a bit outdated, so I hope you understand it so far, but I had the exact same problem and wanted to share my solution. In my case, I am using a Kepware server. If you compile and try to run the client application for this server using Interop.OPCAutomation on a computer on which the server is not installed, you will receive a DLL error message and "entry point not found" if you try to register the dll manually.

Solution: Make sure you have a server installed and running.

0
source

Although this is an old post, I would like to share my solution.

My problem was that when I tried to install the application with OPCAutomation.dll, it gave me error 80040154 because the class was not registered.

This is my solution, always with administrator privileges:

  • Copy the file OPCDAAuto.dll to the folder "C: \ Windows \ System32"
  • At the cmd prompt, type "C: \ Windows \ System32 \ regsvr32 opcdaauto.dll"
  • You should see this message: image

Hope this helps!

0
source

The OPC DLL only works in 32 bits , my solution was to change “Enable 32-bit applications” to “True” in the advanced settings of the relative application pool in IIS.

Application pool

Advanced APP Pool Definition in IIS

0
source

Source: https://habr.com/ru/post/1397489/


All Articles