سؤال

أعلم أن هذه مشكلة شائعة ، ولكن يبدو أن كل ما يمكنني العثور عليه في المنتديات يرتبط بعدم توافق إطار 64 بت (وهو ليس مشكلة في حالتي).

لديّ مجموعة من مثبتات WIX 3.5 البسيطة التي تم تطويرها باستخدام النذري الذي يمكنني تجميعه بسعادة في VS2010 ، ولكن عندما أحاول تجميعها عبر NANT (و MSBUILD) على TeamCity (أي 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

أيه أفكار؟

هل كانت مفيدة؟

المحلول

لقد واجهنا مشكلة مماثلة عند البناء باستخدام Team Build (2010). لقد انتهى بنا الأمر إلى عمل Filemon (يسمى ProcessMonitor هذه الأيام) لـ Winterop.dll على أحد وكلاء البناء لدينا لمعرفة أين كان متوقعًا.

لقد انتهى الأمر بإضافة مجلد الحاوية لتركيب WIX في طريقنا وتم العثور على Winterop.dll فجأة.

نصائح أخرى

اعتمادًا على كيفية قيامك ببناء فريقك ، يمكنك أيضًا إضافة ملف مستهدف يعيد رسم أهداف 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>

هل هناك أي فرصة لعدم تعيين دليل العمل بشكل صحيح؟ أفترض أنك تحقق من أن DLL هناك؟

سأقوم أيضًا بتثبيت .NET 4.0 لإزالة التحذير - قد يؤدي أيضًا إلى القضاء على هذا كسبب محتمل (لا يمكنني التفكير شخصيًا في أي سبب يجعل شيء واضح يتسبب في كسره). ربما في منتصف الطريق ، يمكنك تغيير ToolsVersion العودة إلى 3.5؟

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top