This works for me; in Product.wxs:
<Binary Id="WixMyCustomActions" SourceFile="..\WixMyCustomActions\bin\WixMyCustomActions.CA.dll" /> <CustomAction Id="MyMethod" BinaryKey="WixMyCustomActions" DllEntry="MyMethod" Execute="immediate" Return="check" />
WixMyCustomActions.CA.dll is a C # class library in the same solution as a Wix project. In the project properties of WixMyCustomActions.CA.dll, Build Events, I have a post build event to copy WixMyCustomActions.CA.dll and WixMyCustomActions.CA.pdb from bin \ Debug or bin \ Release to bin:
copy "$(TargetDir)*.dll" "$(ProjectDir)bin" /Y copy "$(TargetDir)*.pdb" "$(ProjectDir)bin" /Y
By copying the dll, my Product.wxs will refer to any configuration (Debug or Release) that was built last.
Edit: to get the file regarding your CA dll, use this to find the CA build directory:
using System.IO; using System.Reflection;
Now you can find files relative to this directory.
Polyfun
source share