Util Extension problems

Sep 28, 2016 at 1:13 AM

I am having a problem using the Event Source element from the util Extension assembly.

My C# code
static void Main(string[] args)
    var project = new Project("NamespaceTest", new Dir(@"%ProgramFiles%\Test") {IsInstallDir = true});


and my wxi file.
    <Component Id="EventSourceId" Guid="{FFFFFFFF-F53E-48A2-B24B-9D410448FC39}" KeyPath="yes" SharedDllRefCount="yes" Directory="INSTALLDIR">
        <util:EventSource  Name="Custom Event Source" Log="Application" EventMessageFile="SomeAssembly.dll" />
When I compile and run the code I the build fails and says 'util' is an undeclared prefix in file. When i look in the generated .wxs file the namespace is missing in the Wix element event though i set it to include the extension.

Does anyone know how to make this work in any way? It would also be nice to know to use all the other wix extension that are not yet in the Wix# code.

Have a great day,
Sep 28, 2016 at 1:58 AM
Thank you,

It is a defect. It is in fact a side effect of issue#63 fix, which after regeneration of the the whole XML doc doesn't reintroduces the original namespaces.
I am promoting your post into an issue.

Until the fix is available unfortunately the only choice you have is to use WixSourceGenerated event where you can manually add namespace. See InjectXML sample.
Sep 28, 2016 at 1:58 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Sep 28, 2016 at 2:11 AM
The fix was simple and it is done already.
If you really keen you can grab "src\WixSharp.Samples\WixSharp.UI.dll" v1.0.43.2 from Git. It already contains the fix. But I will not have time to do the NuGet release until next week.

> It would also be nice to know to use all the other wix extension that are not yet in the Wix# code.
Your code is absolutely correct. It is the way of integrating the WiX extensions. It's just that Wix# defect prevented you from succeeding.