Trouble building a BizTalk orchestration with MSBuild - msbuild

I've got a BizTalk 2010 project I am trying to build via Cruise Control .NET. The weird thing is that it's having trouble with the CompileODX target, within the XLangTask. I can compile via MSBuild.exe on the command line, and when my account runs Cruise Control. However, when Cruise Control is running as a designated service account, it fails. The service account has Full Control on a parent of the directory containing the references (I only have Read/Execute). The service account is a local Admin on the box running Cruise Control service and has been rebooted.
I added some logging within the target to output the parameters to the XLangTask task along with the errors.
[exec] CompileODX:
[exec] XLangItems = CarrierSolicitProcess.odx
[exec] ProjectReferences = C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.External.Maps\bin\Release\Echo.BAS.TLAutoTender.External.Maps.dll;C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.External.Schemas\bin\Release\Echo.BAS.TLAutoTender.External.Schemas.dll;C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Internal.Maps\bin\Release\Echo.BAS.TLAutoTender.Internal.Maps.dll;C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Internal.Schemas\bin\Release\Echo.BAS.TLAutoTender.Internal.Schemas.dll;\\hq.echogl.net\files\Development\Release\Assemblies\Echo.Enterprise.BizTalk.FederatedEventingPortTypes\Implementations\Trunk\Echo.Enterprise.BizTalk.FederatedEventingPortTypes.dll;\\hq.echogl.net\files\Development\Release\Assemblies\Echo.Enterprise.FederatedMessaging\Implementations\Trunk\Echo.Enterprise.FederatedMessaging.dll;\\hq.echogl.net\files\Development\Release\Assemblies\Echo.Enterprise.FederatedMessaging.EventSchemas\Implementations\HEAD\Echo.Enterprise.FederatedMessaging.EventSchemas.dll;\\hq.echogl.net\files\Development\Release\Assemblies\Echo.Enterprise.Framework\Implementations\Trunk\Echo.Enterprise.Framework.dll;\\hq.echogl.net\files\Development\Release\Assemblies\Echo.USS.BizTalkEdiSchemas.CorrelationProperties\Implementations\HEAD\Echo.USS.BizTalkEdiSchemas.CorrelationProperties.dll;C:\Windows\assembly\GAC_MSIL\Microsoft.BizTalk.DefaultPipelines\3.0.1.0__31bf3856ad364e35\Microsoft.BizTalk.DefaultPipelines.dll;C:\Windows\assembly\GAC_MSIL\Microsoft.BizTalk.GlobalPropertySchemas\3.0.1.0__31bf3856ad364e35\Microsoft.BizTalk.GlobalPropertySchemas.dll;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies\Microsoft.BizTalk.Pipeline.dll;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies\Microsoft.BizTalk.TestTools.dll;C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll;C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Configuration.dll;C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll;C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll;C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.dll;C:\Program Files (x86)\Microsoft BizTalk Server 2010\Microsoft.XLANGs.BaseTypes.dll;C:\Program Files (x86)\Microsoft BizTalk Server 2010\Microsoft.XLANGs.RuntimeTypes.dll;C:\Program Files (x86)\Microsoft BizTalk Server 2010\Microsoft.BizTalk.Interop.Agent.dll;C:\Program Files (x86)\Microsoft BizTalk Server 2010\Microsoft.BizTalk.Messaging.dll;C:\Program Files (x86)\Microsoft BizTalk Server 2010\Microsoft.XLANGs.Engine.dll;C:\Program Files (x86)\Microsoft BizTalk Server 2010\Microsoft.XLANGs.BizTalk.Engine.dll;C:\Program Files (x86)\Common Files\Microsoft BizTalk\Microsoft.RuleEngine.dll;C:\Program Files (x86)\Microsoft BizTalk Server 2010\Microsoft.XLANGs.BizTalk.ProcessInterface.dll;C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Data.dll;C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Web.Services.dll;C:\Program Files (x86)\Common Files\Microsoft BizTalk\Microsoft.BizTalk.TOM.dll
[exec] WarningLevel = 4
[exec] BpelCompliance = True
[exec] DefineConstants = TRACE
[exec] TreatWarningsAsErrors = false
[exec] TempAssembly = obj\Release\Echo.BAS.TLAutoTender.Processes.CarrierSolicit.ClrTypes.dll
[exec] OutputDirectory = obj\Release\BizTalk\XLang\
[exec] C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\CarrierSolicitProcess.odx(917,48): error X2186: identifier 'EnterpriseEventSchema' does not exist in 'Echo.Enterprise.FederatedMessaging'; are you missing an assembly reference? [C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\Echo.BAS.TLAutoTender.Processes.CarrierSolicit.btproj]
[exec] C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\CarrierSolicitProcess.odx(917,48): error X2007: cannot find symbol 'Echo.Enterprise.FederatedMessaging.EnterpriseEventSchema' [C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\Echo.BAS.TLAutoTender.Processes.CarrierSolicit.btproj]
[exec] C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\CarrierSolicitProcess.odx(917,13): error X2153: a porttype operation can only contain messagetypes or class types [C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\Echo.BAS.TLAutoTender.Processes.CarrierSolicit.btproj]
[exec] C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\CarrierSolicitProcess.odx(924,48): error X2186: identifier 'EnterpriseEventSchema' does not exist in 'Echo.Enterprise.FederatedMessaging'; are you missing an assembly reference? [C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\Echo.BAS.TLAutoTender.Processes.CarrierSolicit.btproj]
[exec] C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\CarrierSolicitProcess.odx(924,48): error X2007: cannot find symbol 'Echo.Enterprise.FederatedMessaging.EnterpriseEventSchema' [C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\Echo.BAS.TLAutoTender.Processes.CarrierSolicit.btproj]
[exec] C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\CarrierSolicitProcess.odx(924,13): error X2153: a porttype operation can only contain messagetypes or class types [C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\Echo.BAS.TLAutoTender.Processes.CarrierSolicit.btproj]
[exec] C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\CarrierSolicitProcess.odx(931,48): error X2186: identifier 'EnterpriseEventSchema' does not exist in 'Echo.Enterprise.FederatedMessaging'; are you missing an assembly reference? [C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\Echo.BAS.TLAutoTender.Processes.CarrierSolicit.btproj]
[exec] C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\CarrierSolicitProcess.odx(931,48): error X2007: cannot find symbol 'Echo.Enterprise.FederatedMessaging.EnterpriseEventSchema' [C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\Echo.BAS.TLAutoTender.Processes.CarrierSolicit.btproj]
[exec] C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\CarrierSolicitProcess.odx(931,13): error X2153: a porttype operation can only contain messagetypes or class types [C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\Echo.BAS.TLAutoTender.Processes.CarrierSolicit.btproj]
[exec] C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\CarrierSolicitProcess.odx(938,48): error X2186: identifier 'EnterpriseEventSchema' does not exist in 'Echo.Enterprise.FederatedMessaging'; are you missing an assembly reference? [C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\Echo.BAS.TLAutoTender.Processes.CarrierSolicit.btproj]
[exec] C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\CarrierSolicitProcess.odx(938,48): error X2007: cannot find symbol 'Echo.Enterprise.FederatedMessaging.EnterpriseEventSchema' [C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\Echo.BAS.TLAutoTender.Processes.CarrierSolicit.btproj]
[exec] C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\CarrierSolicitProcess.odx(938,13): error X2153: a porttype operation can only contain messagetypes or class types [C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\Echo.BAS.TLAutoTender.Processes.CarrierSolicit.btproj]
[exec] C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\CarrierSolicitProcess.odx(992,44): error X2186: identifier 'EventProperties' does not exist in 'Echo.Enterprise.FederatedMessaging'; are you missing an assembly reference? [C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\Echo.BAS.TLAutoTender.Processes.CarrierSolicit.btproj]
[exec] C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\CarrierSolicitProcess.odx(992,44): error X2007: cannot find symbol 'Echo.Enterprise.FederatedMessaging.EventProperties.carrierId' [C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\Echo.BAS.TLAutoTender.Processes.CarrierSolicit.btproj]
[exec] C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\CarrierSolicitProcess.odx(992,9): error X2166: a correlationtype can only contain message property references [C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\Echo.BAS.TLAutoTender.Processes.CarrierSolicit.btproj]
[exec] C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\CarrierSolicitProcess.odx(992,106): error X2186: identifier 'EventProperties' does not exist in 'Echo.Enterprise.FederatedMessaging'; are you missing an assembly reference? [C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\Echo.BAS.TLAutoTender.Processes.CarrierSolicit.btproj]
[exec] C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\CarrierSolicitProcess.odx(992,106): error X2007: cannot find symbol 'Echo.Enterprise.FederatedMessaging.EventProperties.operationContextId' [C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\Echo.BAS.TLAutoTender.Processes.CarrierSolicit.btproj]
[exec] C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\CarrierSolicitProcess.odx(992,71): error X2166: a correlationtype can only contain message property references [C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\Echo.BAS.TLAutoTender.Processes.CarrierSolicit.btproj]
[exec] C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\CarrierSolicitProcess.odx(992,60): error X2166: a correlationtype can only contain message property references [C:\CCNetBuild\FlexTMS.TLAutoTender.BizTalk\Trunk\Echo.BAS.TLAutoTender.Processes.CarrierSolicit\Echo.BAS.TLAutoTender.Processes.CarrierSolicit.btproj]
[exec] : 'EventProperties.carrierId'

It seems that the build process cannot locate your EnterpriseEventSchema, is the dll for this schema present in the GAC on the build server?

Related

error MSB4018: The "CopyRefAssembly" task failed unexpectedly

This error just seems to happen randomly. I've done an internet search, but nothing turns up. If I clean out the bin, obj, and .vs directories, it will fix it for a few builds and then the error will come back.
1>------ Build started: Project: GridViewOnly, Configuration: Debug Any CPU ------
1>Failed to check the content hash of the destination ref assembly 'C:\Users\myuser\source\repos\GridViewOnly\bin\Debug\net5.0-windows\ref\GridViewOnly.dll'. It will be overwritten.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4413,5): error MSB4018: The "CopyRefAssembly" task failed unexpectedly.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4413,5): error MSB4018: System.InvalidOperationException: The "CopyRefAssembly" task has not registered its resources. In order to use the "TaskLoggingHelper.FormatResourceString()" method this task needs to register its resources either during construction, or via the "TaskResources" property.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4413,5): error MSB4018: at Microsoft.Build.Shared.ErrorUtilities.ThrowInvalidOperation(String resourceName, Object[] args)
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4413,5): error MSB4018: at Microsoft.Build.Shared.ErrorUtilities.VerifyThrowInvalidOperation(Boolean condition, String resourceName, Object arg0)
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4413,5): error MSB4018: at Microsoft.Build.Utilities.TaskLoggingHelper.FormatResourceString(String resourceName, Object[] args)
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4413,5): error MSB4018: at Microsoft.Build.Utilities.TaskLoggingHelper.LogErrorWithCodeFromResources(String messageResourceName, Object[] messageArgs)
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4413,5): error MSB4018: at Microsoft.CodeAnalysis.BuildTasks.CopyRefAssembly.Copy()
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4413,5): error MSB4018: at Microsoft.CodeAnalysis.BuildTasks.CopyRefAssembly.Execute()
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4413,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4413,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
1>Done building project "GridViewOnly.csproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Add ProduceReferenceAssembly as false in csproj file of your solution
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
</PropertyGroup>
I used the configuration manager to create an x64 configuration and that seems to fix it. I haven't encountered the problem since I did that a couple days ago, anyway. Before, I was just using the default AnyCPU configuration. I wound up deleting it because I know I don't need it.

MSBuild fails with an error in the "AL" task with error code AL1019

We are currently having problems while compiling a solution with MSBuild. The build fails randomly on the resource linking step inside the task "AL" which executes the "AL.exe" linker.
ALINK : error AL1019: Metadata failure while creating assembly -- The volume for a file has been externally altered so that the opened file is no longer valid.
The build log shows the following execution flow.
4>Target "GenerateSatelliteAssemblies" in file "C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets" from project "C:\source\MyProject.csproj" (target "CreateSatelliteAssemblies" depends on it):
4>Building target "GenerateSatelliteAssemblies" completely.
4>Output file "obj\Debug\de\MyProject.dll" does not exist.
4>Task "MakeDir"
4>Done executing task "MakeDir".
4>Task "AL"
4> C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\AL.exe /culture:de /out:obj\Debug\de\MyProject.resources.dll /template:obj\Debug\MyProject.dll /embed:obj\Debug\MyProject.SomeResource.de.resources
4> Microsoft (R) Assembly Linker version 14.0.0081.0
4> Copyright (C) Microsoft Corporation. All rights reserved.
4>
4>Done executing task "AL".
4>Done building target "GenerateSatelliteAssemblies" in project "MyProject.csproj".
4>Target "GenerateSatelliteAssemblies" in file "C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets" from project "C:\source\MyProject.csproj" (target "CreateSatelliteAssemblies" depends on it):
4>Building target "GenerateSatelliteAssemblies" completely.
4>Output file "obj\Debug\en\MyProject.resources.dll" does not exist.
4>Task "MakeDir"
4>Done executing task "MakeDir".
4>Task "AL"
4> C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\AL.exe /culture:en /out:obj\Debug\en\MyProject.resources.dll /template:obj\Debug\MyProject.dll /embed:obj\Debug\MyProject.SomeResource.en.resources
4> Microsoft (R) Assembly Linker version 14.0.0081.0
4> Copyright (C) Microsoft Corporation. All rights reserved.
4>
4>ALINK : error AL1019: Metadata failure while creating assembly -- The volume for a file has been externally altered so that the opened file is no longer valid.
4> The command exited with code 1.
4>Done executing task "AL" -- FAILED.
4>Done building target "GenerateSatelliteAssemblies" in project "MyProject.csproj" -- FAILED.
To me it is completely unclear what is meant by the error code AL1019. The MSDN error code listing didn't help either.

ILMerge, .NET 4, NuGet: Unresolved assembly reference not allowed: CommandLine

ILMerge, .NET 4, NuGet: Unresolved assembly reference not allowed: CommandLine
I'm trying to pack my project into single dll.
I'm using:
- Visual Studio 2015
- NuGet
- ILMerge
To achieve my goal, I'd took ILMerge batch file
Added a post-build event:
"d:\#programming\#visual_studio\merge_all.bat" "$(TargetPath)" $(ConfigurationName)
Then slightly modified batch file to get rid of duplicate errors and add some hooks to try to eliminate "Unresolved assembly reference" error.
Unfortunately, none of Google Suggestions
Brought any relief.
So, I still got an error:
Unresolved assembly reference not allowed: CommandLine.
Here's my ILMerge batch file:
#ECHO OFF
rem # usage
rem # "path\to\merge_all.bat" "$(TargetPath)" $(ConfigurationName)
rem # "d:\#programming\#visual_studio\merge_all.bat" "$(TargetPath)" $(ConfigurationName)
rem # set .NET version and output folder name
set net_version=v4
set net_path="C:\Windows\Microsoft.NET\Framework\v4.0.30319"
set net_path_v1="%ProgramFiles%\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client"
set net_path_v2="%ProgramFiles%\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0"
set net_path_v3="%ProgramFiles%\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6"
set target_platform=%net_version%,%net_path_v3%
set lib_path="%ProgramFiles%\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0"
set output=merged
set ILMerge=%ProgramFiles%\Microsoft\ILMerge\ILMerge.exe
rem # parsing arguments
set target_path=%1
set target_file=%~nx1
set target_dir=%~dp1
set ConfigurationName=%2
rem # set output path and result file path
set outdir=%target_dir%%output%
set result=%outdir%\%target_file%
set log_file="%outdir%\merge.log"
set primary_assembly=%target_path%
rem # a little looping voodoo from microsoft to get rid of "duplicate" error
setlocal EnableDelayedExpansion
set "other_assemblies="
for %%f in (%target_dir%*.dll) do (
if NOT %%~nxf==%target_file% (
set "other_assemblies=!other_assemblies! %target_dir%%%~nxf"
)
)
setlocal DisableDelayedExpansion
rem # print info
#echo Start %ConfigurationName% Merging %target_file%.
#echo Target: %target_path%
#echo target_dir: %target_dir%
#echo Config: %ConfigurationName%
#echo Log: %log_file%
#echo primary assembly: %primary_assembly%
#echo other assemblies: %other_assemblies%
rem # recreate outdir
IF EXIST "%outdir%" rmdir /S /Q "%outdir%"
md "%outdir%"
set options= /wildcards /targetplatform:%target_platform% /log:%log_file% /out:"%result%" %primary_assembly% %other_assemblies%
rem # run merge cmd
#echo Merging: '"%ILMerge%" %options%'
"%ILMerge%" %options%
rem # if succeded
IF %ErrorLevel% EQU 0 (
rem # clear real output folder and put there result assembly
IF %ConfigurationName%==Release (
del %target_dir%*.*
del %target_dir%*.dll
del %target_dir%*.pdb
del %target_dir%*.xml
del %target_dir%*.*
copy %result% %target_dir%
rmdir /S /Q %outdir%
set result=%target_path%
#echo Result: %target_file% "-> %target_path%"
) ELSE (
#echo Result: %target_file% "-> %result%" )
set status=succeded
set errlvl=0
) ELSE (
set status=failed
set errlvl=1
)
#echo Merge %status%
exit %errlvl%
Here's the output of build process:
1>------ Rebuild All started: Project: YouTrackSharpApiWrapper, Configuration: Debug Any CPU ------
1>D:\#programming\#visual_studio\YouTrackSharpApiWrapper\ApiWrapper.cs(59,21,59,22): warning CS0168: The variable 'e' is declared but never used
1> YouTrackSharpApiWrapper -> D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\YouTrackSharpApiWrapper.dll
1> Start Debug Merging YouTrackSharpApiWrapper.dll.
1> Target: "D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\YouTrackSharpApiWrapper.dll"
1> target_dir: D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\
1> Config: Debug
1> Log: "D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\merged\merge.log"
1> primary assembly: "D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\YouTrackSharpApiWrapper.dll"
1> other assemblies: D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\EasyHttp.dll D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\JsonFx.dll D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\YouTrackSharp.dll
1> Merging: '"C:\Program Files (x86)\Microsoft\ILMerge\ILMerge.exe" /wildcards /targetplatform:v4,"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6" /log:"D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\merged\merge.log" /out:"D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\merged\YouTrackSharpApiWrapper.dll" "D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\YouTrackSharpApiWrapper.dll" D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\EasyHttp.dll D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\JsonFx.dll D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\YouTrackSharp.dll'
1> Merge failed
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: The command ""d:\#programming\#visual_studio\merge_all.bat" "D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\YouTrackSharpApiWrapper.dll" Debug" exited with code 1.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
And here's the log of ILMerge:
ILMerge version 2.12.803.0
Copyright (C) Microsoft Corporation 2004-2006. All rights reserved.
ILMerge /wildcards /targetplatform:v4,C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6 /log:D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\merged\merge.log /out:D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\merged\YouTrackSharpApiWrapper.dll D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\YouTrackSharpApiWrapper.dll D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\EasyHttp.dll D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\JsonFx.dll D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\YouTrackSharp.dll
Set platform to 'v4', using directory 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6' for mscorlib.dll
Running on Microsoft (R) .NET Framework v2.0.50727
mscorlib.dll version = 2.0.0.0
The list of input assemblies is:
D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\YouTrackSharpApiWrapper.dll
D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\EasyHttp.dll
D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\JsonFx.dll
D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\YouTrackSharp.dll
The number of files matching the pattern D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\YouTrackSharpApiWrapper.dll is 1.
D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\YouTrackSharpApiWrapper.dll
Trying to read assembly from the file 'D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\YouTrackSharpApiWrapper.dll'.
Successfully read in assembly.
There were no errors reported in YouTrackSharpApiWrapper's metadata.
The number of files matching the pattern D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\EasyHttp.dll is 1.
D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\EasyHttp.dll
Trying to read assembly from the file 'D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\EasyHttp.dll'.
Successfully read in assembly.
There were no errors reported in EasyHttp's metadata.
The number of files matching the pattern D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\JsonFx.dll is 1.
D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\JsonFx.dll
Trying to read assembly from the file 'D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\JsonFx.dll'.
Can not find PDB file. Debug info will not be available for assembly 'D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\JsonFx.dll'.
Successfully read in assembly.
There were no errors reported in JsonFx's metadata.
The number of files matching the pattern D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\YouTrackSharp.dll is 1.
D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\YouTrackSharp.dll
Trying to read assembly from the file 'D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\YouTrackSharp.dll'.
Successfully read in assembly.
There were no errors reported in YouTrackSharp's metadata.
Checking to see that all of the input assemblies have a compatible PeKind.
YouTrackSharpApiWrapper.PeKind = ILonly
EasyHttp.PeKind = ILonly
JsonFx.PeKind = ILonly
YouTrackSharp.PeKind = ILonly
All input assemblies have a compatible PeKind value.
AssemblyResolver: Assembly 'EasyHttp' is referencing assembly 'System.Core'.
AssemblyResolver: Attempting referencing assembly's directory.
AssemblyResolver: Did not find assembly in referencing assembly's directory.
AssemblyResolver: Attempting input directory.
AssemblyResolver: Did not find assembly in input directory.
AssemblyResolver: Attempting user-supplied directories.
AssemblyResolver: No user-supplied directories.
AssemblyResolver: Attempting framework directory.
Can not find PDB file. Debug info will not be available for assembly 'System.Core'.
Resolved assembly reference 'System.Core' to 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6\System.Core.dll'. (Used framework directory.)
AssemblyResolver: Assembly 'YouTrackSharp' is referencing assembly 'System.Management.Automation'.
AssemblyResolver: Attempting referencing assembly's directory.
AssemblyResolver: Did not find assembly in referencing assembly's directory.
AssemblyResolver: Attempting input directory.
AssemblyResolver: Did not find assembly in input directory.
AssemblyResolver: Attempting user-supplied directories.
AssemblyResolver: No user-supplied directories.
AssemblyResolver: Attempting framework directory.
AssemblyResolver: Did not find assembly in framework directory.
AssemblyResolver: Unable to resolve reference. (It still might be found, e.g., in the GAC.)
AssemblyResolver: Assembly 'YouTrackSharp' is referencing assembly 'CommandLine'.
AssemblyResolver: Attempting referencing assembly's directory.
AssemblyResolver: Did not find assembly in referencing assembly's directory.
AssemblyResolver: Attempting input directory.
AssemblyResolver: Did not find assembly in input directory.
AssemblyResolver: Attempting user-supplied directories.
AssemblyResolver: No user-supplied directories.
AssemblyResolver: Attempting framework directory.
AssemblyResolver: Did not find assembly in framework directory.
AssemblyResolver: Unable to resolve reference. (It still might be found, e.g., in the GAC.)
Using assembly 'YouTrackSharpApiWrapper' for assembly-level attributes for the target assembly.
Merging assembly 'YouTrackSharpApiWrapper' into target assembly.
Merging assembly 'EasyHttp' into target assembly.
Merging assembly 'JsonFx' into target assembly.
Assembly level attribute 'System.Security.AllowPartiallyTrustedCallersAttribute' from assembly 'JsonFx' being deleted from target assembly
Merging assembly 'YouTrackSharp' into target assembly.
Copying 1 Win32 Resources from assembly 'YouTrackSharpApiWrapper' into target assembly.
There were no errors reported in the target assembly's metadata.
ILMerge: Writing target assembly 'D:\#programming\#visual_studio\YouTrackSharpApiWrapper\bin\Debug\merged\YouTrackSharpApiWrapper.dll'.
AssemblyResolver: Assembly 'YouTrackSharp' is referencing assembly 'Microsoft.CSharp'.
AssemblyResolver: Attempting referencing assembly's directory.
AssemblyResolver: Did not find assembly in referencing assembly's directory.
AssemblyResolver: Attempting input directory.
AssemblyResolver: Did not find assembly in input directory.
AssemblyResolver: Attempting user-supplied directories.
AssemblyResolver: No user-supplied directories.
AssemblyResolver: Attempting framework directory.
Can not find PDB file. Debug info will not be available for assembly 'Microsoft.CSharp'.
Resolved assembly reference 'Microsoft.CSharp' to 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6\Microsoft.CSharp.dll'. (Used framework directory.)
An exception occurred during merging:
Unresolved assembly reference not allowed: CommandLine.
at System.Compiler.Ir2md.GetAssemblyRefIndex(AssemblyNode assembly)
at System.Compiler.Ir2md.GetTypeRefIndex(TypeNode type)
at System.Compiler.Ir2md.VisitReferencedType(TypeNode type)
at System.Compiler.Ir2md.GetMemberRefIndex(Member m)
at System.Compiler.Ir2md.GetMethodToken(Method m)
at System.Compiler.Ir2md.VisitConstruct(Construct cons)
at System.Compiler.Ir2md.VisitExpressionList(ExpressionList expressions)
at System.Compiler.Ir2md.VisitConstruct(Construct cons)
at System.Compiler.Ir2md.VisitAssignmentStatement(AssignmentStatement assignment)
at System.Compiler.Ir2md.VisitBlock(Block block)
at System.Compiler.Ir2md.VisitBlock(Block block)
at System.Compiler.Ir2md.VisitMethodBody(Method method)
at System.Compiler.Ir2md.VisitMethod(Method method)
at System.Compiler.Ir2md.VisitClass(Class Class)
at System.Compiler.Ir2md.VisitModule(Module module)
at System.Compiler.Ir2md.SetupMetadataWriter(String debugSymbolsLocation)
at System.Compiler.Ir2md.WritePE(Module module, String debugSymbolsLocation, BinaryWriter writer)
at System.Compiler.Writer.WritePE(String location, Boolean writeDebugSymbols, Module module, Boolean delaySign, String keyFileName, String keyName)
at System.Compiler.Writer.WritePE(CompilerParameters compilerParameters, Module module)
at ILMerging.ILMerge.Merge()
at ILMerging.ILMerge.Main(String[] args)
Sorry for a long post, but I've got not enough mana to insert more than 2 links, so had to paste log right in thread, and Markdown support here really sucks.
AssemblyResolver: Assembly 'YouTrackSharp' is referencing assembly 'CommandLine'.
It seems like some your components has a reference to CommandLine component, while the ILMerge parameter string doesn't contains that reference (as I can see from your log).
In attempt to resolve this issue try to specify /useFullPublicKeyForReferences parameter for ILMerge call. If it doesn't help, try to specify CommandLine library location at the end.

msbuild - UnitTestFramework reference could not be resolved

I'm trying to run msbuild in Jenkins.
When it reaches the UniTest-Project an error occures:
Project "C:\Program Files (x86)\Jenkins\jobs\***\workspace\***.sln" (1) is building "C:\Program Files (x86)\Jenkins\jobs\***\workspace\***.unitTests\***.unitTests.csproj" (4) on node 0 (default targets).
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".
ResolveAssemblyReferences:
Primary reference "Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL".
Could not find dependent files. Could not load file or assembly 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
For SearchPath "{Registry:Software\Microsoft\.NetFramework,v4.0,AssemblyFoldersEx}".
Considered "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VSTSDB\Microsoft.VisualStudio.QualityTools.UnitTestFramework.exe", but it didn't exist.
Considered "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VSTSDB\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll", but it didn't exist.
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\2.0\Runtime\v4.0\Microsoft.VisualStudio.QualityTools.UnitTestFramework.exe", but it didn't exist.
Considered "C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\2.0\Runtime\v4.0\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll", but it didn't exist.
Considered "C:\Program Files (x86)\MySQL\MySQL Connector Net 6.3.6\Assemblies\v2.0\Microsoft.VisualStudio.QualityTools.UnitTestFramework.exe", but it didn't exist.
Considered "C:\Program Files (x86)\MySQL\MySQL Connector Net 6.3.6\Assemblies\v2.0\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll", but it didn't exist.
Considered "C:\Program Files (x86)\MySQL\MySQL Connector Net 6.3.6\Assemblies\v4.0\Microsoft.VisualStudio.QualityTools.UnitTestFramework.exe", but it didn't exist.
Considered "C:\Program Files (x86)\MySQL\MySQL Connector Net 6.3.6\Assemblies\v4.0\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll", but it didn't exist.
Considered "C:\Program Files (x86)\Microsoft.NET\Primary Interop Assemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.exe", but it didn't exist.
Considered "C:\Program Files (x86)\Microsoft.NET\Primary Interop Assemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll", but it didn't exist.
Considered "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.exe", but it didn't exist.
CalculatorServiceTest.cs(1,17): error CS0234: The type or namespace name 'VisualStudio' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
CalculatorServiceTest.cs(11,10): error CS0246: The type or namespace name 'TestMethod' could not be found (are you missing a using directive or an assembly reference?)
CalculatorServiceTest.cs(11,10): error CS0246: The type or namespace name 'TestMethodAttribute' could not be found (are you missing a using directive or an assembly reference?)
CalculatorServiceTest.cs(24,10): error CS0246: The type or namespace name 'TestMethod' could not be found (are you missing a using directive or an assembly reference?)
CalculatorServiceTest.cs(24,10): error CS0246: The type or namespace name 'TestMethodAttribute' could not be found (are you missing a using directive or an assembly reference?)
CalculatorServiceTest.cs(37,10): error CS0246: The type or namespace name 'TestMethod' could not be found (are you missing a using directive or an assembly reference?)
CalculatorServiceTest.cs(37,10): error CS0246: The type or namespace name 'TestMethodAttribute' could not be found (are you missing a using directive or an assembly reference?)
CalculatorServiceTest.cs(6,6): error CS0246: The type or namespace name 'TestClass' could not be found (are you missing a using directive or an assembly reference?)
CalculatorServiceTest.cs(6,6): error CS0246: The type or namespace name 'TestClassAttribute' could not be found (are you missing a using directive or an assembly reference?)
Done Building Project "C:\Program Files (x86)\Jenkins\jobs\***\workspace\***.unitTests\***.unitTests.csproj" (default targets) -- FAILED.
Done Building Project "C:\Program Files (x86)\Jenkins\jobs\***\workspace\***.sln" (default targets) -- FAILED.
Build FAILED.
Any suggestions what the problem could be? Running ms build from the command works for the solution and without any additional parameters when the project was compiles in VS bevor. After a clean solution the same errors occur. Must be some parameter or reference problem; Line two talks bout v4 and v3.5 problems; but i can't figure out how to solve this.
Greets
Error info directly shows that you use incorrect version of MSBuild
This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
Try to rebuild with MSBuild 4.0
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe *.sln /t:rebuild
OR/AND from VS2010 Command Line.
I had a similar problem which seemed to be caused by running Jenkins as a service under the SYSTEM account. Somehow cmd.exe was not referencing all the necessary environment variables to be able to find my NUnit assemblies.
If you're running Jenkins as a service, try setting it to run as your user account and see if that helps.
Im building from the default windows cmd using:
C:...\MSBuild.exe *.sln
The solution-projects are all 3.5; only the Unit-Test Project is 4.0 (as you can't change this)
I just mentioned, that building it that way works, when i build it first with VS and don't deleted (clean solution) the binaries. Never mind.
How do i have to use msbuild from cmd to build a *.sln including unittests?

WIX 3.5 fails under NAnt but not under VS2010

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?
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.
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>
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 ?
This sounds like a known issue: http://sourceforge.net/tracker/?func=detail&aid=3037918&group_id=105970&atid=642714