I\'m trying to create a custom action with \"Value\" attribute, I want to pass parameters to the C# code (the TARGETDIR and the version).
However, I get an error sta
Note, you're using Value
attribute in the wrong way:
...this attribute must be used with the Property attribute to set the property...Source
Based on the Creating WiX Custom Actions in C# and Passing Parameters article you should:
Create properties with desired values:
Create custom action to set the InstallDir
property:
Create custom action:
Schedule custom actions for execution during installation process:
...
Access those properties from your custom action as follows:
[CustomAction]
public static ActionResult YourCustomAction(Session session)
{
// session["InstallDir"]
// session["Version"]
}