2012-08-13 82 views
1

我只是用维克斯启动时失败,与零知识的C#/。NET创建框架WiX的扩展

现在我想通过参考这个网页创建一个简单的WiX的扩展名:WiX3 - Simple Example of Extension

下面是该页面中描述的步骤:

  • 在Visual Studio中创建一个新的C#库(.dll)命名SampleWixExtension项目。
  • 将对wix.dll的引用添加到您的项目中。
  • 添加引用Microsoft.Tools.WindowsInstallerXml命名空间的using语句。

    using Microsoft.Tools.WindowsInstallerXml;

  • 建立从WixExtension您SampleWixExtension类继承。

    public class SampleWixExtension : WixExtension {}

  • 添加AssemblyDefaultWixExtensionAttribute到你的AssemblyInfo.cs。

    [assembly: AssemblyDefaultWixExtension(typeof(SampleWixExtension.SampleWixExtension))]

  • 生成项目。

然而,当我完成这些步骤,并建立了这个项目,我遇到了以下错误:

------ 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 

任何人都知道为什么,以及如何解决它?

顺便说一句,在Solution Explorer中,我可以看到wix已经在参考文献,它的属性有C:\Program Files (x86)\Windows Installer XML v3.5\bin\wix.dll

回答

4

路径通过添加

using Microsoft.Tools.WindowsInstallerXml; 

到AssemblyInfo.cs中,该项目现已建成successfuly。