This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: CoCreateObjectDotNet throws error code: -2147219705
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 29, 2011
06:40 AM
CoCreateObjectDotNet throws error code: -2147219705
Hi....
I have used CoCreateObjectDotnet to call a .net dll function. Below is the code:
function CreateABC(hMSI)
OBJECT tnaObj;
begin
try
set Obj=CoCreateObjectDotNet(INSTALLDIR^"Products\\ABC\\service\\ABC.Service.exe", "ABC.tAuthority");
if (!IsObject(Obj)) then
//MessageBox("CoCreateObjectDotNet object creation failed",INFORMATION);
SprintfBox(INFORMATION,"CoCreateObjectDotNet object creation failed",Err.Description,Err.Number);
else
Obj.GenerateForABC() ;
endif;
catch
SprintfBox(INFORMATION,"CoCreateObjectDotNet Error","ERROR: %s NUMBER: %d",Err.Description,Err.Number);
endcatch;
end;
I have created a custom action which calls this method and put that in installation sequence. Now I created the setup for my application.
When I install this setup on some machine where visual studio is installed it works fine. But if I install the same setup on machine where .net framework 1.1, 2.0, 3.0 and 3.5 are installed but visual studio is not the setup doesn't work. It throws error with code -2147219705.
I have commented function call code and checked that error comes while creating object for class containing function.
As I am very new to installshield i don't have any qlue to resolve it. Can anyone help me or give me some work around to solve this problem.
Thanks in advance,
anci
I have used CoCreateObjectDotnet to call a .net dll function. Below is the code:
function CreateABC(hMSI)
OBJECT tnaObj;
begin
try
set Obj=CoCreateObjectDotNet(INSTALLDIR^"Products\\ABC\\service\\ABC.Service.exe", "ABC.tAuthority");
if (!IsObject(Obj)) then
//MessageBox("CoCreateObjectDotNet object creation failed",INFORMATION);
SprintfBox(INFORMATION,"CoCreateObjectDotNet object creation failed",Err.Description,Err.Number);
else
Obj.GenerateForABC() ;
endif;
catch
SprintfBox(INFORMATION,"CoCreateObjectDotNet Error","ERROR: %s NUMBER: %d",Err.Description,Err.Number);
endcatch;
end;
I have created a custom action which calls this method and put that in installation sequence. Now I created the setup for my application.
When I install this setup on some machine where visual studio is installed it works fine. But if I install the same setup on machine where .net framework 1.1, 2.0, 3.0 and 3.5 are installed but visual studio is not the setup doesn't work. It throws error with code -2147219705.
I have commented function call code and checked that error comes while creating object for class containing function.
As I am very new to installshield i don't have any qlue to resolve it. Can anyone help me or give me some work around to solve this problem.
Thanks in advance,
anci
(13) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 29, 2011
06:45 AM
Did you create the dll?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 29, 2011
06:47 AM
ABC.Service.exe is having that function.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 29, 2011
06:49 AM
Has it got the COM VISIBLE attribute set?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 29, 2011
06:55 AM
Yes , I put COMVisible in assembly.info and above tAuthority class also...I have Checked in Installshield Tool-> Options -> .Net also
regsm is pointing to
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe
InstallUtilLib is pointing to
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtilLib.dll
deployment machine has everything in place still its not working there 😞
regsm is pointing to
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe
InstallUtilLib is pointing to
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtilLib.dll
deployment machine has everything in place still its not working there 😞
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 29, 2011
06:56 AM
Try using DotNetCoCreateObject instead of the one you are using and let me know.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 29, 2011
07:00 AM
Already tried...but same issue
DotNetCoCreateObject("dll path", ""Class name", "");
Does these two methods requires any special installation of .net framework on deployment machine, bcoz as i said it works on machine where visual studio is installed..
DotNetCoCreateObject("dll path", ""Class name", "");
Does these two methods requires any special installation of .net framework on deployment machine, bcoz as i said it works on machine where visual studio is installed..
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 29, 2011
07:11 AM
Try installing vcredist 2005 or 2008 or 2010(according to the VS installed on successful machines) on any of the machines where it fails and try the install. Any of them, if missing, will cause issues.
NOTE:
vcredist 2010 will not be enough for apps that need vcredist 2008 or 2005. So installing vcredist 2010 will be of no use. You have to install vcredist 2005 for apps that need it even if your machine has vcredist 2010 already installed.
NOTE:
vcredist 2010 will not be enough for apps that need vcredist 2008 or 2005. So installing vcredist 2010 will be of no use. You have to install vcredist 2005 for apps that need it even if your machine has vcredist 2010 already installed.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 29, 2011
07:42 AM
I tried installing all versions 2005, 2008 and 2010 of vcredist but none semms to be working ...still stucked with same issue :mad:
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 29, 2011
07:48 AM
What is the class name?
If it is tAuthority, try using just that tAuthority in the parameter rather than using ABC.tAuthority.
If it is tAuthority, try using just that tAuthority in the parameter rather than using ABC.tAuthority.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 29, 2011
08:06 AM
but ABC is namespace name....still i tried but no luck
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 29, 2011
08:10 AM
Questions:
a) Are you calling any other .NET assembly prior to this call to CoCreateObjectDotNet()? If yes, what .NET version does that depend on?
b) Are you calling the same .NET assembly prior to this particular call?
c) As you are calling this dll from INSTALLDIR, I assume that you are installing it into the system. Are you calling it at the right point in the execution sequence?
d) The file has to be present on the system for the call to be successful. So have you sequenced your CA after InstallFinalize or such actions?
Provide the answers to these queries. Also, perform the following steps if you feel you are doing the other things right:
vcredist installation was suggested in desperation. But I would suggest you open ProcMon.exe and look at the version of .NET being used by the installer.
A mismatch in the version being used at run time can be the issue.
Run ProcMon.exe first on a machine where your installation succeeds. Note the version of .NET being used. Then repeat the step on the machine where it fails.
You know what version your assembly was compiled in?
Even if you do not know, Procmon.exe readings on the machine where your installation succeeds will tell you the correct version of .NET needed.
a) Are you calling any other .NET assembly prior to this call to CoCreateObjectDotNet()? If yes, what .NET version does that depend on?
b) Are you calling the same .NET assembly prior to this particular call?
c) As you are calling this dll from INSTALLDIR, I assume that you are installing it into the system. Are you calling it at the right point in the execution sequence?
d) The file has to be present on the system for the call to be successful. So have you sequenced your CA after InstallFinalize or such actions?
Provide the answers to these queries. Also, perform the following steps if you feel you are doing the other things right:
vcredist installation was suggested in desperation. But I would suggest you open ProcMon.exe and look at the version of .NET being used by the installer.
A mismatch in the version being used at run time can be the issue.
Run ProcMon.exe first on a machine where your installation succeeds. Note the version of .NET being used. Then repeat the step on the machine where it fails.
You know what version your assembly was compiled in?
Even if you do not know, Procmon.exe readings on the machine where your installation succeeds will tell you the correct version of .NET needed.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 03, 2011
01:12 AM
HI...
I have checked .. actually the issue is with one of the dll getting deployed on other machine.. It is .net C++ dll which require some dependent libraried to be installed on system...I run redist_vc86 also as suggested by u still it doesn't come up....can i include the same in installer...what are redistributables for that?
I have checked .. actually the issue is with one of the dll getting deployed on other machine.. It is .net C++ dll which require some dependent libraried to be installed on system...I run redist_vc86 also as suggested by u still it doesn't come up....can i include the same in installer...what are redistributables for that?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 25, 2011
02:29 PM
I saw this thread before when I was researching if IS 2010 will support .NET 4.0 DLLs..... but now that I've actually converted my previously working .NET 3.5 DLL to 4.0, I get the same error (-2147219705).
So, what version of .NET is that DLL compiled with?
So, what version of .NET is that DLL compiled with?
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)