Register COM Interop dll using InstallShield - installshield-2010

I am trying to register COM Interop dlls using Installshield from last 10 days but still found no luck. Here's the issue:
I have an Installscript project with some ActiveX controls and dlls. Now I want to replace some ActiveX with .NET com Interop dlls created on VS2010 using C#.net. I am registering those
com Interop dlls using batch file.
So the Issue is , If VS2010 is installed on the client machine then application works properly but If .NET Framework is Installed on the client machine instead of VS2010 , dlls get registered but application doesn't work and throws an error "Make sure the Object is entered in the system registry".
Any idea on what I am doing wrong? Any help will be appreciated.
Thanks in advance.

Related

Breakpoints not triggering in VSTO Add-in

I was made aware of an interesting situation by my client today. I am sure it is something simple but seems like I can't put my finger on it. Have never faced this issue and Google has not been too helpful.
Problem
On my client's laptop, the Add-In is created with Add-in Express™ for Microsoft® Office and .net. When running the Add-in from VS, the breakpoints do not trigger. I logged in via teamviewer. We created a new test project (Add-in) and added this simple code.
Private Sub AdxExcelAppEvents1_WorkbookOpen(sender As Object, hostObj As Object) Handles _
AdxExcelAppEvents1.WorkbookOpen
MessageBox.Show ("Hello World")
End Sub
I put a breakpoint on AdxExcelAppEvents1_WorkbookOpen and ran. I got the message when I opened a new workbook but the breakpoint did not trigger.
I tested the same code on my laptop and it works just fine.
What has he and I tried
Unregister, Clean + Rebuild, Register
Manually cleaning the Debug folder
Repairing Add-In Express
Uninstalling/ReInstalling Add-In Express
Jumping between frameworks 4.5 and 4.6, 4.7.1
Toggling Tools | Options | Debugging | General require source files to exactly match the original version
Toggling Solution platforms (x86|64|AnyCPU)
Applications
Visual Studio Version: 2019 Pro
MS Office: 2016 Professional Plu 2016
Let me know if you need anything else?
FYI: This has been crossposted at Add-in Express forum I usually do not crosspost but seems like my client is under pressure and has to deliver this project on monday morning.
You can use the method Debugger.Break from System.Diagnostics and observe if you get more information about a plausible unhandled exception. In this case, we get the exception wkernelbase.pdb not loaded and Siddharth found it can be fixed by selecting : Tools->Options->Debugging->Symbols->Select "Microsoft Symbol Servers".
I suppose there's an {excel}.exe.config file in the Office folder. The .config requires all add-ins to use .NET 2.0 (3.0, 3.5).
That would explain the issue: you use .NET 2.0 (3.0, 3.5) while the debugger expects to use .NET 4.0 (4.X).
And yes, Add-in Express is built around the COM Add-in technology, not VSTO Add-in.

Using interop.MSProject.dll without Office installed or creating Project Add-in in Visual Studio

I need to work on Project Server using Microsoft.Office.Interop.MSProject.dll from Visual Studio.
Using gacutil.exe I have registered Microsoft.Office.Interop.MSProject.dll and at folder "C:\Windows\assembly" there is entry for MSProject.dll whose processor architecture is MSIL.
I have created Console Application and when I try to create Application instance it gives error:
Class not registered-HRESULT: 0x80040154 exception. As shown in image.
Target platform for this project is x86(32-bit). What could be the reason for the error?
Is it because office is not installed on local machine? Is there any alternative to using PIA without installing Office?
I have tried creating Project Add-in from Visual Studio, it works successfully, but it requires Project Professional to be open, which I want to avoid. Is it possible to avoid opening of Project Professional application in this case?
You need to have the Application (i.e. MS Project) installed on the PC. Interop files sre used for marshalling property or method calls from a managed code to the host application.

How to use redistributable PIA 2010 to create excel application on machine which doesn't have MS Office client installed

From last couple of days I'm struggling with redistributable PIA 2010. Actually I have created one excel application locally, which uses 2007 PIA (I have also MS Office installed on my machine). This application was working fine, now I have installed the 2010 PIA and register it's Microsoft.Office.Interop.Excel dll then I have deleted then added this new dll in my earlier created excel application, but now application crashes on creation of excel object. i.e.
var app = new Application();
and below error is showing on browser.
Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Excel.Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{000208D5-0000-0000-C000-000000000046}' failed due to the following error: Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)).
Now, could anyone tell me what exactly wrong am I doing? Is this is the right approach to create excel application using only redistributable PIA 2010. If not, please help me out what is the correct approach to resolve this.
Redistributable PIAs are just a "complement" required by VS 2008 and older. The given MS Office version has to be installed on the target computer anyway. If you created an application relying on the Microsoft Excel Object of Office 2010 (version 14.0), it would only work on computers where Office 2010 is installed. If, on top of that, you built it by using VS 2008 or older, you would have also to install the corresponding PIA package.

VSTO 2010 excel addins cannot be loaded on target xp machine

I published my excel addins with clickonce on vs2010.
It`s prerequisites contains .net framework 4 client,vsto 2010 and installer3.5.
Deploying it on win7 works well,when I deploy it on xp,installing no error occured,
but it(com) cannot loaded when run excel app.
I tried mang mehods,only when I manually installed .net framework 2.0 or 3.0 or 3.5
my addin will appear
I donot know why.
thanks
Here's a dumb question, when deploying are your users installing the .vsto or the setup.exe (aka bootstrap). If they are installing the just the .vsto file they aren't getting any of the pre-reqs. They live in the setup.exe. Also are you installing the PIAs (or are you using the embedded PIAs which is new to 2010)? Win7 machines tend to have the right pre-reqs but when you go back in time on XP they don't.

Excel UDF formula does not appear

I have an Excel UDF . It is written in C# and the automation addon has been packaged using the Visual Studio setu up project wizard. The addon loads in the list of automation addons available but the formula does not appear in the Insert function formula dialogue box.
I used Office 2003 and Visual Studio 2008 to build the addin. The client machine has .Net Framework 2.0 installed and does not have any installation of VS.
Should I have to enable the udf specifically somewhere ? This problem appears only when I am packaging the addon to distribute it to a client machine.
Thanks,
The fact that the COM add-in appears in the availale list of automation add-ins would imply that the COM add-in has been successfully registered on the target machine.
Could it be a Trust issue? You can check the level of trust your assembly has using the Microsoft .NET Framework Configuration: http://support.microsoft.com/kb/815147
I suspect you'll need full-trust.
I haven't built add-ins with COM for a while (I can list the alternatives if you like), so let me know if this doesn't fix it and I'll look into it further.

Resources