Problems launching QB program on a separate machine - c#

I'm making a program for a friend, but when I try to launch this on his machine, I get this error. I tried launching this on a separate machine as well, and this same error happens.
Retrieving the COM class factory for component with CLSID {C693D8F1-180B-4F82-B735-8F511B566718} failed due to the following error: 80040154.
When I try to run it on my PC, where I made this app, it runs.
I changed the platform target to x86, and when I debug on a separate machine it takes me to this line, with that error.
QBSessionManager sessionManager = new QBSessionManager();
Help please.

Did you run the QBFC installer on the other machine? I seem to recall getting this error when I forgot to do that on a client's PC. That would take care of registering QBFC COM objects.

Related

Can't instantiate multiple VFP COM Dlls: 80004005 Unspecified error

I've got two sample VFP9 OlePublic dlls that I'm calling from a .NET Core 2.1 project running full framework .NET 4.6.1. Everything is working fine locally but upon deployment to a Windows Server 2016 machine, I'm only able to instantiate an instance of a.dll or b.dll, not both. It seems the last one to be registered wins.
If I register a.dll then b.ll, I can instantiate an instance of b & vice versa.
Retrieving the COM class factory for component with CLSID {CF0998BA-54F1-40BD-BB92-4E938A77E1E5} failed due to the following error: 80004005 Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)).
Define Class miked As Session OLEPUBLIC
FUNCTION HelloWorld as String
RETURN "Hello World"
ENDFUNC
FUNCTION Echo(thingToEcho as String) as String
RETURN thingToEcho
ENDFUNC
Enddefine
public void TestMikeDll()
{
new miked.miked();
}
I'm guessing I haven't configured/defined something correctly in my VPF9 projects? 🤔
publish profile:
update
So it's not the last one registered, it's the first one to get instantiated. If I successfully instantiate a.dll then b.dll fails but if I recyle the app pool & try b.dll first it succeeds & a.dll fails.
Give the AppPool identity write (maybe modify too) access to the location of the VFP COM Dlls. Apparently, it needs to dynamically create another DLL: [original name]r1.dll that has a file desc of "Microsoft Visual FoxPro 9.0 SP2 Runtime Library" (the purple box).
Go to properties on folder where COM DLLs live
Security Tab
Edit
Add
in enter the object names to select: IIS AppPool\[your AppPool name]
reference: MSFT doc page on giving AppPool identity file permissions
credit: this comment from Aloio Kraus lead me down the path:
the 5 of the error code is the Win32 error code which means access denied. I would run procmon and watch for registry/file accesses which fail. That should hint to the right direction what went wrong

ALM C# application

I am using Interop.TDAPIOLELib dll to connect to ALM (application lifecycle managment).
In order to connect to the project i am using TDConnection but when executing this line
_connection = new TDAPIOLELib.TDConnection();
i get this exception
Retrieving the COM class factory for component with CLSID {C5CBD7B2-490C-45F5-8C40-B8C3D108E6D7} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
This code was working fine before i repaired my HD
I run sfc/scannow and i got this message Windows Resource Protection did not find any integrity violations. Which indicate that i do not have any missing or corrupted system files.
any suggestions?
OTAClient.dll should be registered
using regsvr32.exe register the OTAClient.dll it located in this path C:\Program Files (x86)\Common Files\Mercury Interactive\TDAPIClient and make sure that the application is run under x86 target.
It's necesary to download the TDConnect.exe
Go to your HP ALM web interface
'Tool' link
'HP ALM Connectivity' link
Click on 'Download HP ALM Connectivity'
it will download TDConnect.exe file, you need to do this trhu your instance to match the TDConnect.exe with your version, for example if you are running HP ALM 11.52 you MUST download the TDConnect.exe for this version.
although this is an old question, but sharing what worked for me - the solution mentioned here - http://www.juvander.fi/site/Forums/tabid/129/forumid/2/threadid/14/scope/posts/Default.aspx
may help someone if nothing else works

Interop service error occured when using InternetExplorerClass

i am trying to deploy an asp.net web service application to IIS 7.5. The application used .Net framework 3.5. dev machine is win 7 64bit. i have used following code snippet to create HTML and then convert it to pdf using Amyuni Document Converter 450.
private InternetExplorer internetExplorer = new InternetExplorerClass();
when i deploy the application in local development server it perfectly run but whn i deploy it using the local iis server it gives following error. any reasons for that.. i have used impersonate='true'
System.Runtime.InteropServices.COMException (0x80080005): Retrieving the COM class factory for component with CLSID {0002DF01-0000-0000-C000-000000000046} failed due to the following error: 80080005.
You have to change property in DComConfig for ie.
Follow the next steps:
Start->Run->dcomcnfg->Component services>Computers>My Computer
Right click on My Computer and select Properties. On the Security COM tab set the Default Autethentication level and Default Impersonation level.

c# OPC Automation gives 80040154

I am a .Net developer. New to OPC. When I tried some samples of OPC Client all of them give this error. It seems the DLL is not registered it seems. But I don't know how and where to register this.
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 it also throws error like
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 have gone through so many existing forums. So many of them said to change the Platform Target to x86 and still I am having the same issue. FYI, I can see only see 'Active (Any CPU)' in the Platform option from the top of the Build tab of Project Properties.
Here are my environment details:
.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!
Just in case somebody is dealing with this problem (as I've recently been...) I get through it! After some time, I found out that it's something about the .NET framework running on 64-bit machines. As long as the.NET application works only with 32-bit CLR, we must set .NET framework to load CLR in WOW mode. To do so, type:
C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Ldr64.exe SetWow
After this you should be able to run the applications.
You can go back and revert .NET Framework as it was before by typing:
C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Ldr64.exe Set64
If the OPC Client Toolkit SDK (C++) is used, a problem with the remote registry service may cause this error as well.
On Windows 7, by default the Remote Registry service is set to manual and not started. Ensure that the Remote Registry service is started on all of the machines you want to deploy to. This can be done manually or using Group Policy.
The function GetCLSIDFromRemoteRegistry() uses the RemoteRegistryService in order to get the CLSID of an OPC Server. If this service is not started on the client machine, the OPC program may return the error 80040154.
The error you're getting is more than likely due to the OPC server not being properly registered. Make sure it is registered (usually by running it at the command line with a "/regserver" or "/service" parameter). There may also be security issues in which case you'd have to run 'dcomcnfg' (DCOM Config) to make sure the client has access to the server.
This question is a bit dated so I hope you figured it out by now, but I had the same exact issue and wanted to share my solution. In my case, I am using a Kepware server. If you compile and try to run a client application for this server using Interop.OPCAutomation on a machine that does not have the server installed, you will get a dll not registered error and "entry point not found" if you try to register the dll manually.
Solution: Make sure you've got the server installed and running.
Although this is an old post, I would like to share my solution.
My problem was that when I tried to install an application with the OPCAutomation.dll, it gave me 80040154 error because the class was not registered.
This is my solution, always with Administrator privileges:
Copy OPCDAAuto.dll into the "C:\Windows\System32" folder
On the cmd prompt type "C:\Windows\System32\regsvr32 opcdaauto.dll"
You should watch a message like this one:
image
Hope this helps!
The OPC dll only works in 32 Bits, my solution was to change the "Enable 32-Bit Applications" to True in the advanced settings of the relative app pool in IIS.

C# Interop - can't create object

I've created a C# COM object, and am trying to instantiate it from VBscript (under Windows Scripting Host).
The assembly builds correctly, etc, and RegAsm claims that it is successfully registered. However, whenever I try to instantiate it in a .vbs script, I get:
Error: Could not creawte object named
"MyProgId.blah" Code: 80040154
I'm running Win7 x64 Ultimate, object built for .NET 3.5 with VS2010.
I also tried copying the compiled DLL over to a Win Server 2003 machine, and I get the same results there.
Help.
Also, of note: I can register, but not instantiate, any of our old VB6 COM DLLs. (Yes, I am running the script as administrator.)
Update
Just for grins, I created a test application that uses Type.GetFromProgID() to find and create the object:
Type t = Type.GetTypeFromProgID(progId);
if (t == null)
{
Console.WriteLine("Couldn't create object.");
}
else
{
var obj = Activator.CreateInstance(t);
Console.WriteLine("Successfully created Object: Type is [{0}]", obj);
Console.WriteLine("Calling method [{0}]\n\n", methodName);
var result = t.InvokeMember(methodName, BindingFlags.Default | BindingFlags.InvokeMethod, null, obj, null);
Console.WriteLine("Result: {0}", result);
}
This works correctly. Attempting to create the object from VBscript, however, still fails.
Argh.
Update, the 2nd
After running SysInternals ProcMon, I see quite a few registry queries looking for the progID and guid under HKCU\Software\Classes\..., where there is no mention of the object (when I look in RegEdit). There are quite a few NAME NOT FOUND errors.
I've tried registering with the %windir%\microsoft.net\framework\v4... and framework64 versions of regasm, with no effect.
I'm running Win7 x64 Ultimate
That's very relevant to COM issues like these. The error message means that the COM client could not find the registry information for the COM server. The 64-bit version of Windows has two VB-script interpreters, a 64-bit and a 32-bit version. Processes with different bitness have a different view of the registry, a 64-bit client cannot see 32-bit COM servers. And the other way around.
What matters is what version of Regasm.exe you used. There are two, one in C:\Windows\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe, another in Framework64. You by default run the 32-bit version which enters registration info in the 32-bit view of the registry. You should use the 64-bit version from Framework64 instead. Or use both, .NET creates COM servers that can run in both bitnesses.
If you still have trouble then use SysInternals' ProcMon tool to see where the script interpreter is looking for the CLSID key.
If you're running a 32-bit interface under a 64-bit OS, you can get around that VBScript error by using the wscript/cscript under \windows\syswow64 (instead of the default under \windows\system32) to run your script. That tripped me up for a day.
I think that it is possible you are looking at a security issue.
Check out this stackoverflow post and see if this solves your issue.
Cannot instanciate .Net COM object in classic ASP/VBScript page (Error ASP 0177)

Categories