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

发布于 2024-09-14 23:21:34 字数 2737 浏览 15 评论 0原文

我知道这是一个常见问题,但我在论坛中找到的所有内容似乎都与 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

有什么想法吗?

I know this a is a common issue, but everything I can find in the forums seems to relate to 64bit framework incompatability (which is not an issue in my case).

I have a set of simple WIX 3.5 installers developed using Votive that I can compile happily in VS2010, but when I try to compile them via NAnt (and MSBuild) on TeamCity (i.e. TeamCity -> Nant -> MSBuild -> WIX) I get the following error:

 [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

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

陪你搞怪i 2024-09-21 23:21:34

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

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

We had a similar issue when building using Team Build (2010). We ended up doing a filemon (its called processmonitor these days) for winterop.dll on one of our build agents to see where it was expected.

We ended up adding the bin folder of the wix installation in our path and suddenly winterop.dll was found.

春风十里 2024-09-21 23:21:34

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

Depending on how you do your team build you can also add a target file that re-maps the wix targets, tools and paths and then sets up the 'RunWixToolsOutOfProc' item to run it out of band. Here's a chunk of my target file that maps the three paths. Just change the initial property to wherever you usually put your wix files.

<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>
当爱已成负担 2024-09-21 23:21:34

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

我还会安装 .NET 4.0 来删除警告 - 也可能会消除这个潜在原因(个人无法想到任何简单的原因会导致它崩溃)。也许作为一个中途之家,您可以将 ToolsVersion 更改回 3.5 ?

Is there any chance you're not setting the working directory right? I assume you've verified the DLL is there?

I'd also install .NET 4.0 to remove the warning - might as well eliminate this as a potential cause (can't personally think of any reason why something straightforward would cause it to break). Perhaps as a half way house you could change the ToolsVersion back to 3.5 ?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文