cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Mystique
Level 5

DotNetCoCreatedObject crash problem

I have a InstallScript MSI project. I am trying to call a manged dll function from InstallScript project using DotNetCoCreateObject. But when the code is run during installation, I got this error:

Error Number: 0x80040707
Description: Dll function call crashed: ISRT.DotNetCoCreateObject

Does anybody know the reason of this problem? Thanks for any help.
Labels (1)
0 Kudos
(10) Replies
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

Can you provide any additional information about how you are calling DotNetCoCreateObject? Does this happen with any project you try this code in? Can this issue be reproduced with a sample .NET assembly?
0 Kudos
Mystique
Level 5

I created a very simple dll called MyDll and here is the code.

dllPath = SUPPORTDIR ^ "MyDll.dll";
svReturn = UseDLL(dllPath);

if( svReturn = 0) then
set myObj = DotNetCoCreateObject(dllPath, "MyDll.Class1", "");
endif;
UnUseDLL(dllPath);

It crashed on set myObj line with the following error:
Error Number: 0x8004070
Description: Dll function call crashed: ISRT._DotNetCoCreateObject

Setup will now terminate.

--------------------------------------------------

Thanks for your help.
0 Kudos
Roman1
Level 9

Hi,
Please put the dll whole project as zip, too.
0 Kudos
Mystique
Level 5

Thanks for your help.
0 Kudos
RobertDickau
Flexera Alumni

(It probably doesn't have a bearing on the issue, but you don't need UseDLL or UnUseDLL for a .NET assembly; that pair is for C-callable DLLs.)
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

The class in the attached sample DLL needs to be marked as ComVisible.
0 Kudos
Mystique
Level 5

That worked. Thank you (both) for your help.
0 Kudos
Gvarma
Level 7

joshstechnij wrote:
The class in the attached sample DLL needs to be marked as ComVisible.


Hi,

I have the same issue here, though in my case DLL was working fine unless I changed Target Framework to 3.5 sp1 and i started getting this error, now I have revereted it back to .NET 2.0 but i am still getting the same error...

I have MSI Installscript project.

Any sugessations?
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

You may try using a utility such as .NET Reflector to ensure the assembly or class you are trying to use in InstallScript is still marked as ComVisible.
0 Kudos
pankaj_kumar
Level 2

Mystique wrote:
I have a InstallScript MSI project. I am trying to call a manged dll function from InstallScript project using DotNetCoCreateObject. But when the code is run during installation, I got this error:

Error Number: 0x80040707
Description: Dll function call crashed: ISRT.DotNetCoCreateObject

Does anybody know the reason of this problem? Thanks for any help.


Just install .net framework 4.5 through GUI itself.issue will be solved. Hope it will
0 Kudos