I just started using WiX, with zero knowledge of C#/.NET
Now I’m trying to create a simple WiX extension by referring this page: WiX3 – Simple Example of Extension.
Here is steps described in that page:
-
In Visual Studio, create a new C# library (.dll) project named SampleWixExtension.
-
Add a reference to wix.dll to your project.
-
Add a using statement that refers to the Microsoft.Tools.WindowsInstallerXml namespace.
using Microsoft.Tools.WindowsInstallerXml; -
Make your SampleWixExtension class inherit from WixExtension.
public class SampleWixExtension : WixExtension {} -
Add the AssemblyDefaultWixExtensionAttribute to your AssemblyInfo.cs.
[assembly: AssemblyDefaultWixExtension(typeof(SampleWixExtension.SampleWixExtension))] -
Build the project.
However, when I finished these steps and built this project, I met following errors:
------ Build started: Project: SampleWixExtension, Configuration: Debug Any CPU ------
D:\working\test\SampleWixExtension\SampleWixExtension\Properties\AssemblyInfo.cs(37,12): error CS0246: The type or namespace name 'AssemblyDefaultWixExtension' could not be found (are you missing a using directive or an assembly reference?)
D:\working\test\SampleWixExtension\SampleWixExtension\Properties\AssemblyInfo.cs(37,12): error CS0246: The type or namespace name 'AssemblyDefaultWixExtensionAttribute' could not be found (are you missing a using directive or an assembly reference?)
Compile complete -- 2 errors, 0 warnings
Anyone know why and how to fix it?
Btw, in the Solution Explorer I can see wix is already in References, its properties has Path of C:\Program Files (x86)\Windows Installer XML v3.5\bin\wix.dll
By adding
into AssemblyInfo.cs, the project is now successfuly built.