【问题标题】:WIX 3.5 fails under NAnt but not under VS2010WIX 3.5 在 NAnt 下失败,但在 VS2010 下失败
【发布时间】:2010-08-18 01:13:05
【问题描述】:

我知道这是一个常见问题,但我在论坛中找到的所有内容似乎都与 64 位框架不兼容有关(在我的情况下这不是问题)。

我有一组使用 Votive 开发的简单 WIX 3.5 安装程序,我可以在 VS2010 中愉快地编译,但是当我尝试通过 TeamCity 上的 NAnt(和 MSBuild)编译它们时(即 TeamCity -> Nant -> 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

有什么想法吗?

【问题讨论】:

    标签: msbuild wix nant wix3.5 votive


    【解决方案1】:

    我们在使用 Team Build (2010) 构建时遇到了类似的问题。我们最终在我们的一个构建代理上为 winterop.dll 做了一个 filemon(这些天称为 processmonitor),以查看它的预期位置。

    我们最终在我们的路径中添加了wix安装的bin文件夹,突然发现了winterop.dll。

    【讨论】:

    • 它转移到构建环境的另一个问题,但我很确定路径方法有效。这是你的!
    【解决方案2】:

    根据您的团队构建方式,您还可以添加一个重新映射 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】:

      有没有可能您没有正确设置工作目录?我假设您已经验证了 DLL 是否存在?

      我还将安装 .NET 4.0 以删除警告 - 不妨将其作为潜在原因消除(个人无法想到任何直接的原因会导致它中断)。也许作为中途之家,您可以将ToolsVersion 改回 3.5?

      【讨论】:

      • 我也许可以在未来的某个阶段安装框架 4,但是(不想经历 Kafka 式的变更请求噩梦)我决定暂时坚持使用框架 3.5。您的回答确实让我想知道 WIX env var 是否会在不重新启动服务器的情况下被 TC 拾取?
      【解决方案4】:

      【讨论】:

      • 我看到了那个线程(主要是“我也是!”),但我没有看到解决这个问题的方法 - 你能建议我解决它的任何方法吗?您是否在 TC/CCNET 中看到过此类问题?这个问题在夜间构建中得到纠正吗?如果它能让我更接近解决方案,我愿意切换到更前沿的版本。
      • “我也是!”正在帮助我们优先考虑尽快解决此问题。观察问题何时真正解决问题。
      猜你喜欢
      • 2018-03-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-21
      • 1970-01-01
      • 2019-07-31
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多