wixsharp: Projects with CustomActions failing to build
Any project including a CustomAction seems to fail. My own project looks like this:
using System;
using System.IO;
using System.Windows.Forms;
using Microsoft.Deployment.WindowsInstaller;
using WixSharp;
namespace Installer
{
class Program
{
static void Main()
{
var project = new Project("Test",
new Dir(@"%ProgramFiles%\Test",
new DirFiles(@"C:\Test\*.*")),
new Dir(@"%ProgramMenu%",
new ExeFileShortcut("Test", Path.Combine("[INSTALLDIR]", "Launcher.exe"),
arguments: "")
{ WorkingDirectory = "[INSTALLDIR]" }),
new ManagedAction(CustomActions.MyAction));
project.GUID = new Guid("93fefff9-91b2-4c44-8b13-9aad00c8f6a3");
project.Platform = Platform.x64;
project.Version = new Version(2, 0, 0, 0);
project.UI = WUI.WixUI_ProgressOnly;
project.MajorUpgradeStrategy = MajorUpgradeStrategy.Default;
project.BuildMsi();
}
}
public static class CustomActions
{
[CustomAction]
public static ActionResult MyAction(Session session)
{
MessageBox.Show("Test", "Test");//Environment.GetCommandLineArgs().ConcatItems(" "));
session.Log("Begin MyAction Hello World");
return ActionResult.Success;
}
}
}
Also, I tried building the AdminInstall sample in Visual Studio, which also fails to build. Still a problem with the VS integration?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 24 (11 by maintainers)
Great. I am glad we sorted it out
I downloaded a fresh copy of 1.9.4, installed it, and it’s now building.
So somehow, the installation in my C:\bin folder had been partially missing. I’m not sure how that happened. But all seems fine now. Thanks for your help getting to the bottom of it!
OK.
Try to define the assembly name explicitly, just in case it’s not resolved correctly:
If this does not help see if you can build ManagedProject with events. It defines managed assembly slightly differently.