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
- :
- SUITE: Cannot find entry point to managed code custom action
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
Oct 28, 2015
06:39 AM
SUITE: Cannot find entry point to managed code custom action
I have a C# managed code custom action that I developed, that when tested independently from InstallShield, works correctly.
But when I try to integrate this into InstallShield I get an error message indicating that it could not find the entry point.
I have been over the steps for this: http://helpnet.flexerasoftware.com/installshield21helplib/helplibrary/SteActionManagedCd.htm
Below is a quick diagram of what I have in my C# code.
[CODE]
using ...
namespace MyCustomAction
{
[Guid[Guid("BAFAEAED-08C6-4679-B94E-487A4D89DE63")]
[TypeLibType(4288)]
public interface ISuiteExtension { ... }
public class DoMyAction
{
const UInt32 ERROR_INSTALL_FAILURE = 1603;
const UInt32 ERROR_SUCCESS = 0;
object _pDispatch = null;
ISuiteExtension _suiteExtension;
ISuiteExtension GetExtensionFromDispatch(object pDispatch)
{
if (Marshal.IsComObject(pDispatch) == false)
throw new System.ContextMarshalException("Invalid dispatch object passed to CLR method");
return (ISuiteExtension)pDispatch;
}
public UInet32 DoMyActionMethod(object pDispatch)
{
_pDispatch = pDispatch;
DoSomething();
return ERROR_SUCCESS;
}
private void DoSomething() { ... }
}
}[/CODE]
In my Suite project I added the .dll file to the events.
I set the class to 'DoMyAction'
I set the method to 'DoMyActionMethod'
Finally I schedule the custom action to run. It tries to run but I get:
What is it that I am missing? Do I need to add a def file like I do with C++ custom actions so the name is not decorated?
What I suspect is that I need to have an explicit constructor as the entry point but if I do that I cannot have a return value, and the example shown on the site referenced above does not have an explicit constructor either.
Thanks.
But when I try to integrate this into InstallShield I get an error message indicating that it could not find the entry point.
I have been over the steps for this: http://helpnet.flexerasoftware.com/installshield21helplib/helplibrary/SteActionManagedCd.htm
Below is a quick diagram of what I have in my C# code.
[CODE]
using ...
namespace MyCustomAction
{
[Guid[Guid("BAFAEAED-08C6-4679-B94E-487A4D89DE63")]
[TypeLibType(4288)]
public interface ISuiteExtension { ... }
public class DoMyAction
{
const UInt32 ERROR_INSTALL_FAILURE = 1603;
const UInt32 ERROR_SUCCESS = 0;
object _pDispatch = null;
ISuiteExtension _suiteExtension;
ISuiteExtension GetExtensionFromDispatch(object pDispatch)
{
if (Marshal.IsComObject(pDispatch) == false)
throw new System.ContextMarshalException("Invalid dispatch object passed to CLR method");
return (ISuiteExtension)pDispatch;
}
public UInet32 DoMyActionMethod(object pDispatch)
{
_pDispatch = pDispatch;
DoSomething();
return ERROR_SUCCESS;
}
private void DoSomething() { ... }
}
}[/CODE]
In my Suite project I added the .dll file to the events.
I set the class to 'DoMyAction'
I set the method to 'DoMyActionMethod'
Finally I schedule the custom action to run. It tries to run but I get:
10-28-2015[07:08:04 AM]: (CLR Action): Could not interpret instance of DoMyAction
What is it that I am missing? Do I need to add a def file like I do with C++ custom actions so the name is not decorated?
What I suspect is that I need to have an explicit constructor as the entry point but if I do that I cannot have a return value, and the example shown on the site referenced above does not have an explicit constructor either.
Thanks.
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Oct 28, 2015
06:46 AM
I just found a link to the same issue:
https://community.flexerasoftware.com/showthread.php?217688-(CLR-Action)-Could-not-interpret-instance-of-in-managed-code-custom-action
Just one recommendation for whoever is doing documentation, if you can make the class declaration requirement a bit clearer, perhaps bold text, in the help page that would be appreciated. I read though this document several times and totally missed the following:
https://community.flexerasoftware.com/showthread.php?217688-(CLR-Action)-Could-not-interpret-instance-of-in-managed-code-custom-action
Just one recommendation for whoever is doing documentation, if you can make the class declaration requirement a bit clearer, perhaps bold text, in the help page that would be appreciated. I read though this document several times and totally missed the following:
The following sample C# code corresponds with a Class setting value of TestCLRAction.TestCLRClass and a Method setting value of TestCLRMethod:
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)