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
- :
- Same problem here
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
‎Jun 11, 2012
04:14 PM
DotNetCoCreateObject Error in IS 2012
My installer cannot call DotNetCoCreateObject.
It gives error number -2147219705.
I've read through as many articles and posts on this error as I can and done all of the fixes but it's still not working. I must be missing something.
The assembly is ComVisible.
The DLL is in the SUPPORTDIR at IS runtime.
The assembly uses the 4.0 framework but I've upgraded to IS 2012 so that shouldn't be an issue, either.
Here's the code:
set helper = DotNetCoCreateObject(SUPPORTDIR ^ "RunSQLScripts.dll","RunSQLScripts.ScriptHelper","");
What am I missing?
Thanks in advance for any help.
It gives error number -2147219705.
I've read through as many articles and posts on this error as I can and done all of the fixes but it's still not working. I must be missing something.
The assembly is ComVisible.
The DLL is in the SUPPORTDIR at IS runtime.
The assembly uses the 4.0 framework but I've upgraded to IS 2012 so that shouldn't be an issue, either.
Here's the code:
set helper = DotNetCoCreateObject(SUPPORTDIR ^ "RunSQLScripts.dll","RunSQLScripts.ScriptHelper","");
What am I missing?
Thanks in advance for any help.
(5) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 09, 2012
10:17 AM
I have exactly the same problem. We built the installer originally in Installshield 2009 with .NET framework 2.0 and have been using it for 3-4 years.
We have now updated our software to utilize .NET framework 4.0 and upgraded to Installshield 2012. The same DotNetCoCreateObject method that has worked should work now from what I have read, but we now get the error number -2147219705. If anyone figures out how to make this work, please let me know. Thanks in advance for any help.
We have now updated our software to utilize .NET framework 4.0 and upgraded to Installshield 2012. The same DotNetCoCreateObject method that has worked should work now from what I have read, but we now get the error number -2147219705. If anyone figures out how to make this work, please let me know. Thanks in advance for any help.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 05, 2013
08:18 AM
I am also running into the issue where DotNetCoCreateObject is failing. Has anyone else found a solution to this problem.
Thanks,
Robert M.
Thanks,
Robert M.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 07, 2013
11:19 AM
I'm also running into the same error.
--Greg
--Greg
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 06, 2014
10:43 AM
There is conflicting information on various posts about whether UseDLL is required before DotNetCoCreateObject. Either way, it does not work for me. I have ComVisible set to TRUE, the DLL exists in the path.
Can someone from Flexera jump in here?
Can someone from Flexera jump in here?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 10, 2014
04:02 AM
Have you got the following line in your AssembyInfo.cs file for your dll?
[assembly: ComVisible(true)]
And for each class and method you want to call they need to have the following attribute...
[ComVisible(true)]
AND Com does not allow static methods to be called, this causes InstallShield to crash without error!
You do NOT need UseDLL.
Here is an example of how to call from InstallScript...
In your C# assembly...
[CODE]namespace MyCompany.MyWibble
{
[ComVisible(true)]
public class MyClass
{
[ComVisible(true)]
public void TestMethod(string testString1, string testString2)
{
// Do something
}
}
}[/CODE]
and in your c# assembly AssemblyInfo.cs
[CODE][assembly: ComVisible(true)][/CODE]
[assembly: ComVisible(true)]
And for each class and method you want to call they need to have the following attribute...
[ComVisible(true)]
AND Com does not allow static methods to be called, this causes InstallShield to crash without error!
You do NOT need UseDLL.
Here is an example of how to call from InstallScript...
OBJECT obj;
set obj= DotNetCoCreateObject("D:\\MyWibble.dll", "MyCompany.MyWibble.MyClass", "MyCompany.MyWibble");
obj.TestMethod("TestString1", "TestString2");
set obj = NOTHING;
DotnetUnloadAppDomain("MyCompany.MyWibble");
In your C# assembly...
[CODE]namespace MyCompany.MyWibble
{
[ComVisible(true)]
public class MyClass
{
[ComVisible(true)]
public void TestMethod(string testString1, string testString2)
{
// Do something
}
}
}[/CODE]
and in your c# assembly AssemblyInfo.cs
[CODE][assembly: ComVisible(true)][/CODE]