ALM C# application - c#

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

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

mso20win32client.dll error when initializing new_RDOSession

I am getting errors in event viewer every time my application runs this line:
Redemption.RDOSession rSession = RedemptionLoader.new_RDOSession();
event viewer error:
faulting application name: (my.exe)
exception code: 0xc0000005
faulting module path: C:\Program Files\Common Files\Microsoft Shared\Office16\mso20win32client.dll
The oddest part is that it proceeds to create the session and makes it to the end of my code if I let it, successfully looking up an email in Outlook. This is in production and has worked for years, but for some months now it has been racking up the same error in Event Viewer. End users don't notice, but IT is seeing thousands of errors now which makes it hard for them to know when other problems might be showing up.
I reproduced this on the first try with:
Windows 10 Home, OS build 19044.1706, Windows Feature Experience Pack 120.2212.4170.0
Outlook: Microsoft® Outlook® for Microsoft 365 MSO (Version 2205 Build 16.0.15225.20172) 64-bit
I added logging in my CS code to make sure this caused the error. The error occurs if set ignoreoutlook to "e", and not if I set it to "d":
Microsoft.Office.Interop.Outlook.Application oApp = (Application)Marshal.GetActiveObject("Outlook.Application");
if (ignoreoutlook.Equals("d")) return;
Redemption.RDOSession rSession = RedemptionLoader.new_RDOSession(); // new Redemption.RDOSession();
if (ignoreoutlook.Equals("e")) return;
As for:
C:\ProgramFiles\Common Files\Microsoft Shared\Office16\mso20win32client.dll
it doesn't exist. There is a dll of that name in both:
C:\Program Files\Microsoft Office\root\vfs\ProgramFilesCommonX86\Microsoft Shared\OFFICE16
C:\Program Files\Microsoft Office\root\vfs\ProgramFilesCommonX64\Microsoft Shared\OFFICE16
If Redemption wants to use that dll, how is it working without it?
Is there a way to configure Redemption to skip that dll and move on to whatever else it must be doing to get it to work after that error?
There are quite a few things going on once the MAPI system (when Redemption loads it and calls MAPIInitialize) initializes common Office runtime, which has a bunch of its own problems, since it loads telemetry and licensing. Some of that functionlity only works when running inside the (virtualized) Office app environment (it patches a few Win API functions etc.)
Check if you see the same problem in MFCMAPI if you log to a profile (to ensure the MAPI system is loaded). If you do, that means the problem is in the MAPI system and you can work with MS support. If not, something is specific to your app.
One thing to keep in mind is that your app must embed a manifest and advertise its support for Windows 10. Otherwise common Office run-time tries to patch wrong Win API functions.

Unable to cast COM object of type 'Microsoft.Office.Interop.Outlook.ApplicationClass' {00063001-0000-0000-C000-000000000046} HRESULT: 0x80040155

I'm having an issue with a very simple piece of C# .NET code which should (for now) simply retrieve the version number of Office installed on the computer running a WinForms application:
var oApp = new Outlook.ApplicationClass();
var outlookVersionString = oApp.Version;
It instantiates the object correct, however when I try and access the Version property, I get the following:
{"Unable to cast COM object of type 'Microsoft.Office.Interop.Outlook.ApplicationClass' to interface type 'Microsoft.Office.Interop.Outlook._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00063001-0000-0000-C000-000000000046}' failed due to the following error: Interface not registered (Exception from HRESULT: 0x80040155)."}
I've done a lot of searching online, so a run-through of what I've tried:
Checking that in [HKEY_CLASSES_ROOT\TypeLib\{00062FFF-0000-0000-C000-000000000046}] only one Key exists (9.6)
Checking that this ClassID and version matches in [HKEY_CLASSES_ROOT\Interface\{00063001-0000-0000-C000-000000000046}]
Registering MSOUTL.OLB with C:\Windows\Microsoft.NET\Framework64\v4.0.30319\regtlibv12.exe "C:\Program Files (x86)\Microsoft Office\root\Office16\MSOUTL.OLB" (fails because regtlibv12.exe isn't shipped with VS2017)
Downloading regtlibv12.exe and trying again (fails because 'This app can't run on your PC').
Running C:\Users\uczms>c:\Windows\Microsoft.NET\Framework64\v4.0.30319\regasm.exe /TLB "C:\Program Files (x86)\Microsoft Office\root\Office16\MSOUTL.OLB" (fails because it is not a valid .NET Assembly)
Running C:\Users\uczms>c:\Windows\Microsoft.NET\Framework64\v2.0.50727\regasm.exe /TLB "C:\Program Files (x86)\Microsoft Office\root\Office16\MSOUTL.OLB" (fails because it is not a valid .NET Assembly)
Using what worked with the old Interop libraries (edit: note, this does not appear to work with our Office 2016 desktops), which is a subtle change:
var oApp = new Outlook.Application();
var outlookVersionString = oApp.Version;
It might be worth noting that I have a clean Windows 10 Enterprise N Creators Update, and Office 2016 / 365 ProPlus, haven't had any previous versions installed, and haven't downgraded.
I'm not normally a desktop app developer so while I grasp some of these library registration tools, I'm by no means an expert..
Try to "repair" your Microsoft Office installation. Go to Programs and Features, select Modify and then Repair Online. I had the same issue and this fixed it.
Some my customers had a similar issues on some PC and the only action that have solved was usign the point 3 "Ensure MSOUTL.LIB is Registered" of this fantastic guide webmakers - Interface not registered (Exception from HRESULT: 0x80040155) – Microsoft Office/Outlook Error, after checked the previous point, obviously.
Thanks to Jatin-Auckland for a clear and step by step guide.
Goodluck ;)
I appreciate this is an old topic, my issue was Visual Studio defaulting to 'Prefer 32-bit' in the project's compile properties for .NET Framework 4.5+. !
Screenshot of Visual Studio Prefer 32-bit checkbox:

Code runs on development server but not on IIS

I have a web application where user run queries(through web interface) and gets output in excel format. Sometimes this output comprises of more than 300k records. The user needs this data for further research.
Now in order to speed up the dynamic excel creation with such large volume of data, we are using "Microsoft.Office.Interop.Excel" COM object.
Our code works completely fine on the in-built asp.net development server. However, when hosted on the IIS, it gives us "Access is Denied" error (exact error is as shown below).
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
I have given all the rights to the IIS user but still this is not working.
I have tried Windows Server 2012 R2 as well as Windows 7 OS and it doesn't work on both of them.
I have made changes to the "DCOMCNFG" and granted access to the web users under the "COM Security" tab also.
What are some additional steps I can take to make this work?
Have a look at the following links -
"Retrieving the COM class factory for component.... error: 80070005 Access is denied." (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
http://forums.iis.net/t/1205506.aspx?Retrieving+the+COM+class+factory+for+component+with+CLSID+failed+due+to+the+following+error+80070005+access+is+denied
https://waheedrous.wordpress.com/2014/01/26/error-office-interop-assemblies/
This is a COM permissions problem.
Start > Run > dcomcnfg
Navigate to Component Services > Computers > My Computer > DCOM Config
Locate the Microsoft Excel Application
Right click > Properties
On the security tab: Select Security under Launch and Activation Permissions and click Edit…
Add the account under which the site is running (eg: Network Service) and assign Local Launch & Local Activation permissions
Source
Also the ASP.NET Authentication should be enabled.
I think for this to work, office has to be installed on the server.
So if this is not the case, install Office on the server.
(alternative is to use OpenXml http://www.microsoft.com/en-us/download/details.aspx?id=30425)
I have decided to give up on using COM object for Excel operation on the server. Instead, I have decided to use EPPlus open office XML SDK for generation of Excel files. This works without any additional security permission requirement on the server.

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.

Categories