views:

59

answers:

2

DTF does not call the second action if the custom action assembly has more than one action. It always calls only the first action. As a workaround, I am using one action in one assembly. It works perfectly always.

Do you have any idea on this issue?

public class CustomActions
{

    [CustomAction]
    public static ActionResult CustomAction1(Session session)
    {
        [some code]
    }


    [CustomAction]
    public static ActionResult CustomAction2(Session session)
    {
        [some code]
    }

}
+1  A: 

I've never seen this problem as I group custom actions together in a single assembly all the time. Each method will be exported as type 1 entry points and then you write a custom action for each exported function. Windows Installer calls the CA which calls the function which fires up the CLR and invokes the static method that the custom action points to.

Christopher Painter
A: 

It might seem an obvious thing, but still. When you define a custom actions in your wxs file, do you specify different values in "DllEntry" attribute? This attribute points out a method, which is actually your CA. If you copy/paste custom action definitions, you might just forget to change the DllEntry...

Yan Sklyarenko
Yan, Yes I do call different method name only in the DllEntry attribute. It works perfectly, when I call them individually. but it fails always when I call sequentially two different CA from the same assembly (or dll). It says that is not able to extract the assembly from the binary.
sankar
Does it depend on the Return attribute of the CA declaration? For instance, if you set Return='check' (which is default) for both CA, is it reproducible?
Yan Sklyarenko