代码之家  ›  专栏  ›  技术社区  ›  Andrew Matthews

WIX 3.5在NAnt下失败,但在VS2010下不失败

  •  2
  • Andrew Matthews  · 技术社区  · 14 年前

    我有一套使用voctive开发的简单wix3.5安装程序,我可以在VS2010中愉快地编译,但是当我尝试通过TeamCity上的NAnt(和MSBuild)编译它们时(即TeamCity->南特->MSBuild->WIX)我得到以下错误:

     [exec] Project file contains ToolsVersion="4.0", which is not supported by this 
                version of MSBuild. Treating the project as if it had ToolsVersion="3.5".
     [exec] Compile:
     [exec]   Microsoft (R) Windows Installer Xml Compiler version 3.5.2006.0
     [exec]   Copyright (C) Microsoft Corporation. All rights reserved.
     [exec]
     [exec]   Product.wxs
     [exec]   Product.Generated.wxs
     [exec] Link:
     [exec]   Microsoft (R) Windows Installer Xml Linker version 3.5.2006.0
     [exec]   Copyright (C) Microsoft Corporation. All rights reserved.
     [exec]
     [exec] light.exe : error LGHT0001: Unable to load DLL 'winterop.dll': The specified module 
               could not be found. (Exception from HRESULT: 0x8007007E)
     [exec]
     [exec]   Exception Type: System.DllNotFoundException
     [exec]
     [exec]   Stack Trace:
     [exec]      at Microsoft.Tools.WindowsInstallerXml.Cab.Interop.NativeMethods.ExtractCabBegin()
     [exec]      at Microsoft.Tools.WindowsInstallerXml.Binder.BindDatabase(Output output, String databaseFile)
     [exec]      at Microsoft.Tools.WindowsInstallerXml.Binder.Bind(Output output, String file)
     [exec]      at Microsoft.Tools.WindowsInstallerXml.Tools.Light.Run(String[] args)
     [exec] Done Building Project "c:\dev2\ad3\utilities\Installers\Database\Database.wixproj" (default targets) -- FAILED.
     [exec] Done Building Project "c:\dev2\ad3\AgentDesktop3.1.sln" (default targets) -- FAILED.
     [exec]
     [exec] Build FAILED.
     [exec]
     [exec] "c:\dev2\ad3\AgentDesktop3.1.sln" (default target) (1) ->
     [exec] "c:\dev2\ad3\utilities\InstallerService\InstallerService.csproj" (default target) (5) ->
     [exec] (ResolveAssemblyReferences target) ->
     [exec]   C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets
                : warning MSB3088: Could not read state file
                "obj\Release\ResolveAssemblyReference.cache". Unable to find assembly
                'Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral,
                PublicKeyToken=b03f5f7f11d50a3a'.
     [exec]
     [exec]
     [exec] "c:\dev2\ad3\AgentDesktop3.1.sln" (default target) (1) ->
     [exec] "c:\dev2\ad3\utilities\Installers\Database\Database.wixproj" (default target) (6) ->
     [exec] (Link target) ->
     [exec]   light.exe : error LGHT0001: Unable to load DLL 'winterop.dll': The specified 
                  module could not be found. (Exception from HRESULT: 0x8007007E)
     [exec]
     [exec]     1 Warning(s)
     [exec]     1 Error(s)
     [exec]
     [exec] Time Elapsed 00:00:05.92
    
     BUILD FAILED
    

    有什么想法吗?

    4 回复  |  直到 10 年前
        1
  •  2
  •   fredrikt    14 年前

    在使用TeamBuild(2010)进行构建时,我们遇到了类似的问题。我们最后为您做了一个filemon(现在称为processmonitor)温特OP.dll在我们的一个构建代理上查看它的预期位置。

    我们最终在路径中添加了wix安装的bin文件夹,突然温特OP.dll找到了。

        2
  •  1
  •   Dan Piessens    14 年前

    根据您的团队构建方式,您还可以添加一个目标文件,重新映射wix目标、工具和路径,然后设置“RunWixToolsOutOfProc”项以在带外运行它。这是我的目标文件的一块,它映射了三条路径。只需将初始属性更改为通常放置wix文件的位置。

    <CreateProperty Value="$(ProductDirRoot)\buildfiles\tasks\wix\">
      <Output TaskParameter="Value" PropertyName="WixToolPath"/>
      <Output TaskParameter="Value" PropertyName="WixExtDir"/>
    </CreateProperty>
    
    <CreateProperty Value="$(WixToolPath)wix.targets">
      <Output TaskParameter="Value" PropertyName="WixTargetsPath"/>
    </CreateProperty>
    
    <CreateProperty Value="$(WixToolPath)wixtasks.dll">
      <Output TaskParameter="Value" PropertyName="WixTasksPath"/>
    </CreateProperty>
    
    <!-- If we didn't find the registry path, assume we're in a 64bit process. -->
    <!-- WiX tools are 32bit EXEs, so run them out-of-proc when MSBuild is 64bit. -->
    <CreateProperty Value="true" Condition=" '$(MSBuildExtensionsPath64)' != '' ">
      <Output TaskParameter="Value" PropertyName="RunWixToolsOutOfProc" />
    </CreateProperty>
    
        3
  •  0
  •   Ruben Bartelink    14 年前

    有没有可能你没有把工作目录设置好?我想你已经确认了DLL在那里了?

    我还安装了.NET4.0来删除这个警告——最好把它作为一个潜在的原因来消除(我个人想不出为什么一些简单的东西会导致它崩溃)。也许作为一个中途的房子你可以改变 ToolsVersion

        4
  •  0
  •   Rob Mensching    14 年前