C# – Visual Studio Installer Project: Custom Action -> entry point not found

ccustom-actioninstallationwindowswindows-installer

I try to add a custom action to a Installer Project. I added a Custom Action Project with following code:

  public class CustomActions
  {
    [CustomAction]
    public static ActionResult CustomAction1(Session session)
    {
      session.Log("Begin CustomAction1");

      return ActionResult.Success;
    }
  }

In my installer Project, I added a reference to the CustomAction_project and added following entry to Custom Actions -> Install:

Name: Primary output from CustomAction (Active)
EntryPoint: CustomAction1
InstallerClass: False
SourcePath: Path to CustomAction.dll

Now, if I try to Build my Installer Project I get following Error:

ERROR: Entry point 'CustomAction1' not found in module
'PATH\CustomAction.dll' for custom action 'Primary output from
CustomAction (Active)'.

  • What do I wrong? The Custom Action code was automatically generated by Visual Studio 2013!

Best Answer

You've built a managed code custom action project that's intended for WiX setups. You need an installer class custom action if you are using a native Visual Studio installer project. These might help:

https://msdn.microsoft.com/en-us/library/vstudio/d9k65z2d(v=vs.100).aspx

http://www.c-sharpcorner.com/uploadfile/ddoedens/usinginstallerclassestoeasedeploymentinvs.net12012005061649am/usinginstallerclassestoeasedeploymentinvs.net.aspx

http://vbcity.com/forums/t/145818.aspx

Basically you add an installer class to your project, and override the install method.

Related Topic