Unternehmen Ich arbeite, um kontinuierliche Integration zu implementieren. Projekte werden mithilfe von Lightswitch mit Visual Studio 2012 entwickelt. Wir verwenden Team Foundation Server zur Verwaltung der Quellversion. Ich habe eine Build-Definition und einen Agentenpool erstellt, um zu versuchen, Build-Prozesse programmatisch mithilfe der MsBuild-Task in TFS auszuführen.Fehler MSB4184 Microsoft.LightSwitch.Publish.targets beim Erstellen eines Projekts mit Team Foundation Build
Alles geht gut außer Build Solution Schritt löst einen Fehler aus. Im Anschluss an der Spur:
2016-08-08T17:30:17.1606552Z Checking if artifacts directory exists: C:\TFSAgent\_work\1\a
2016-08-08T17:30:17.1606552Z Deleting artifacts directory.
2016-08-08T17:30:17.1606552Z Creating artifacts directory.
2016-08-08T17:30:17.1762560Z Checking if test results directory exists: C:\TFSAgent\_work\1\TestResults
2016-08-08T17:30:17.1762560Z Deleting test results directory.
2016-08-08T17:30:17.1762560Z Creating test results directory.
2016-08-08T17:30:17.2230568Z Starting: Get sources
2016-08-08T17:30:17.2386617Z Entering TfvcSourceProvider.PrepareRepositoryAsync
2016-08-08T17:30:17.2386617Z localPath=C:\TFSAgent\_work\1\s
2016-08-08T17:30:17.2386617Z clean=False
2016-08-08T17:30:17.2386617Z sourceVersion=199
2016-08-08T17:30:17.2386617Z mappingJson={"mappings":[{"serverPath":"$/OmniPay","mappingType":"map","localPath":"\\"},{"serverPath":"$/OmniPay/Drops","mappingType":"cloak","localPath":"\\"}]}
2016-08-08T17:30:17.2386617Z Syncing repository: OmniPay (TFVC)
2016-08-08T17:30:17.2386617Z workspaceName=ws_1_3
2016-08-08T17:30:21.4039019Z Workspace Name: ws_1_3;45d6157a-c0a3-480c-9615-310b82a07e0e
2016-08-08T17:30:21.5130997Z tf get /version:199
2016-08-08T17:30:22.6987201Z Done syncing repository OmniPay to version 199 (workspace version C199)
2016-08-08T17:30:22.6987201Z Leaving TfvcSourceProvider.PrepareRepositoryAsync
2016-08-08T17:30:22.9015180Z Running tasks
2016-08-08T17:30:22.9327171Z Starting task: Build solution $/OmniPay/0-Development/OmniMerchant/OmniMerchant.sln
2016-08-08T17:30:22.9951206Z C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". ([scriptblock]::Create('if (!$PSHOME) { $null = Get-Item -LiteralPath ''variable:PSHOME'' } else { Import-Module -Name ([System.IO.Path]::Combine($PSHOME, ''Modules\Microsoft.PowerShell.Management\Microsoft.PowerShell.Management.psd1'')) ; Import-Module -Name ([System.IO.Path]::Combine($PSHOME, ''Modules\Microsoft.PowerShell.Utility\Microsoft.PowerShell.Utility.psd1'')) }')) 2>&1 | ForEach-Object { Write-Verbose $_.Exception.Message -Verbose } ; $env:TF_BUILD = 'True' ; Import-Module -Name 'C:\TFSAgent\tasks\VSBuild\1.0.37\ps_modules\VstsTaskSdk\VstsTaskSdk.psd1' -ArgumentList @{ NonInteractive = $true } -ErrorAction Stop ; $VerbosePreference = 'SilentlyContinue' ; $DebugPreference = 'SilentlyContinue' ; Invoke-VstsTaskScript -ScriptBlock ([scriptblock]::Create('. ''C:\TFSAgent\tasks\VSBuild\1.0.37\VSBuild.ps1'''))"
2016-08-08T17:30:24.8203363Z ##[warning]Visual Studio version '11.0' not found. Looking for the latest version.
2016-08-08T17:30:25.1947427Z ##[command]"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" "C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.sln" /nologo /nr:false /fl /flp:"logfile=C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.sln.log" /dl:CentralLogger,"C:\TFSAgent\tasks\VSBuild\1.0.37\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"*ForwardingLogger,"C:\TFSAgent\tasks\VSBuild\1.0.37\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /p:platform="any cpu" /p:configuration="release" /p:VisualStudioVersion="10.0"
2016-08-08T17:30:25.3195436Z Los proyectos de esta solución se van a compilar de uno en uno. Para habilitar la compilación en paralelo, agregue el modificador "/m".
2016-08-08T17:30:25.3351434Z Compilación iniciada a las 08/08/2016 12:30:25 p. m..
2016-08-08T17:30:25.5223466Z Proyecto "C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.sln" en nodo 1 (destinos predeterminados).
2016-08-08T17:30:25.5223466Z ValidateSolutionConfiguration:
2016-08-08T17:30:25.5223466Z Compilando la configuración de soluciones "release|any cpu".
2016-08-08T17:30:25.7719622Z ##[error]C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\LightSwitch\v3.0\Publish\v1.8\Microsoft.LightSwitch.Publish.targets(31,9): Error MSB4184: La expresión "[System.IO.Path]::Combine(null, bin\x86)" no se puede evaluar. El valor no puede ser nulo. Nombre del parámetro: path1
2016-08-08T17:30:25.7719622Z El proyecto "C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.sln" (1) está compilando "C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.ls3proj" (2) en el nodo 1 (destinos predeterminados).
2016-08-08T17:30:25.7719622Z C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\LightSwitch\v3.0\Publish\v1.8\Microsoft.LightSwitch.Publish.targets(31,9): error MSB4184: La expresión "[System.IO.Path]::Combine(null, bin\x86)" no se puede evaluar. El valor no puede ser nulo. Nombre del parámetro: path1 [C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.ls3proj]
2016-08-08T17:30:25.8031476Z Compilación del proyecto terminada "C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.ls3proj" (destinos predeterminados) -- ERROR.
2016-08-08T17:30:25.8499500Z Compilación del proyecto terminada "C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.sln" (destinos predeterminados) -- ERROR.
2016-08-08T17:30:25.8499500Z ERROR al compilar.
2016-08-08T17:30:25.8499500Z "C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.sln" (destino predeterminado) (1) ->
2016-08-08T17:30:25.8499500Z "C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.ls3proj" (destino predeterminado) (2) ->
2016-08-08T17:30:25.8499500Z C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\LightSwitch\v3.0\Publish\v1.8\Microsoft.LightSwitch.Publish.targets(31,9): error MSB4184: La expresión "[System.IO.Path]::Combine(null, bin\x86)" no se puede evaluar. El valor no puede ser nulo. Nombre del parámetro: path1 [C:\TFSAgent\_work\1\s\0-Development\OmniMerchant\OmniMerchant.ls3proj]
2016-08-08T17:30:25.8499500Z 0 Advertencia(s)
2016-08-08T17:30:25.8499500Z 1 Errores
2016-08-08T17:30:25.8499500Z Tiempo transcurrido 00:00:00.29
2016-08-08T17:30:26.0371525Z ##[error]Process 'msbuild.exe' exited with code '1'.
2016-08-08T17:30:26.1307517Z Finishing task: VSBuild
2016-08-08T17:30:26.1307517Z Starting task: Copy Files to: $(build.artifactstagingdirectory)
2016-08-08T17:30:26.1463517Z Set workingFolder to default: C:\TFSAgent\tasks\CopyFiles\1.0.20
2016-08-08T17:30:26.4583580Z ##[debug]agent.workFolder=C:\TFSAgent\_work
2016-08-08T17:30:26.4583580Z ##[debug]loading inputs and endpoints
2016-08-08T17:30:26.4583580Z ##[debug]loading ENDPOINT_AUTH_$/
2016-08-08T17:30:26.4583580Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_$/_ACCESSTOKEN
2016-08-08T17:30:26.4583580Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2016-08-08T17:30:26.4583580Z ##[debug]loading ENDPOINT_AUTH_SCHEME_$/
2016-08-08T17:30:26.4583580Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2016-08-08T17:30:26.4583580Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2016-08-08T17:30:26.4583580Z ##[debug]loading INPUT_CLEANTARGETFOLDER
2016-08-08T17:30:26.4583580Z ##[debug]loading INPUT_CONTENTS
2016-08-08T17:30:26.4583580Z ##[debug]loading INPUT_OVERWRITE
2016-08-08T17:30:26.4583580Z ##[debug]loading INPUT_SOURCEFOLDER
2016-08-08T17:30:26.4583580Z ##[debug]loading INPUT_TARGETFOLDER
2016-08-08T17:30:26.4583580Z ##[debug]loaded 11
2016-08-08T17:30:26.4583580Z ##[debug]check path : C:\TFSAgent\tasks\CopyFiles\1.0.20\task.json
2016-08-08T17:30:26.4583580Z ##[debug]set resource file to: C:\TFSAgent\tasks\CopyFiles\1.0.20\task.json
2016-08-08T17:30:26.4739560Z ##[debug]system.culture=en-US
2016-08-08T17:30:26.4739560Z ##[debug]Contents=**\bin\release\**
2016-08-08T17:30:26.4739560Z ##[debug]SourceFolder=C:\TFSAgent\_work\1\s
2016-08-08T17:30:26.4739560Z ##[debug]check path : C:\TFSAgent\_work\1\s
2016-08-08T17:30:26.4739560Z ##[debug]TargetFolder=C:\TFSAgent\_work\1\a
2016-08-08T17:30:26.4739560Z ##[debug]CleanTargetFolder=false
2016-08-08T17:30:26.4739560Z ##[debug]OverWrite=false
2016-08-08T17:30:26.4739560Z ##[debug]include content pattern: **\bin\release\**
2016-08-08T17:30:26.7547577Z ##[debug]find C:\TFSAgent\_work\1\s
2016-08-08T17:30:26.7547577Z ##[debug]2219 matches.
2016-08-08T17:30:26.8795588Z ##[debug]allFiles contains 2012 files
2016-08-08T17:30:26.8795588Z ##[debug]Include matching C:\TFSAgent\_work\1\s\**\bin\release\**
2016-08-08T17:30:26.9107601Z ##[debug]Include matched 0 files
2016-08-08T17:30:26.9107601Z found 0 files
2016-08-08T17:30:26.9263593Z Finishing task: CopyFiles
2016-08-08T17:30:26.9419655Z Starting task: Publish Artifact: drop
2016-08-08T17:30:26.9419655Z Set workingFolder to default: C:\TFSAgent\tasks\PublishBuildArtifacts\1.0.34
2016-08-08T17:30:27.2383627Z ##[debug]agent.workFolder=C:\TFSAgent\_work
2016-08-08T17:30:27.2383627Z ##[debug]loading inputs and endpoints
2016-08-08T17:30:27.2383627Z ##[debug]loading ENDPOINT_AUTH_$/
2016-08-08T17:30:27.2383627Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_$/_ACCESSTOKEN
2016-08-08T17:30:27.2539635Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2016-08-08T17:30:27.2539635Z ##[debug]loading ENDPOINT_AUTH_SCHEME_$/
2016-08-08T17:30:27.2539635Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2016-08-08T17:30:27.2539635Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2016-08-08T17:30:27.2539635Z ##[debug]loading INPUT_ARTIFACTNAME
2016-08-08T17:30:27.2539635Z ##[debug]loading INPUT_ARTIFACTTYPE
2016-08-08T17:30:27.2539635Z ##[debug]loading INPUT_PATHTOPUBLISH
2016-08-08T17:30:27.2539635Z ##[debug]loading INPUT_TARGETPATH
2016-08-08T17:30:27.2539635Z ##[debug]loaded 10
2016-08-08T17:30:27.2539635Z ##[debug]check path : C:\TFSAgent\tasks\PublishBuildArtifacts\1.0.34\task.json
2016-08-08T17:30:27.2539635Z ##[debug]set resource file to: C:\TFSAgent\tasks\PublishBuildArtifacts\1.0.34\task.json
2016-08-08T17:30:27.2539635Z ##[debug]system.culture=en-US
2016-08-08T17:30:27.2539635Z ##[debug]PathtoPublish=C:\TFSAgent\_work\1\a
2016-08-08T17:30:27.2539635Z ##[debug]check path : C:\TFSAgent\_work\1\a
2016-08-08T17:30:27.2539635Z ##[debug]ArtifactName=drop
2016-08-08T17:30:27.2539635Z ##[debug]ArtifactType=Container
2016-08-08T17:30:27.2695627Z ##[debug]TargetPath=\\my\share\Merchant\20160808.4
2016-08-08T17:30:28.6267793Z Max Concurrent Uploads 2, Max Creators 1
2016-08-08T17:30:28.7048085Z Found 0 files to upload.
2016-08-08T17:30:28.7203860Z Created 0 files without uploading content. Total files processed 0
2016-08-08T17:30:28.7203860Z Uploaded artifact 'C:\TFSAgent\_work\1\a' to container folder 'drop' of build 24.
2016-08-08T17:30:29.6719971Z Associated artifact 12 with build 24
2016-08-08T17:30:29.6875965Z Finishing task: PublishBuildArtifacts
2016-08-08T17:30:29.7032002Z ##[error]System.Exception: Task VSBuild failed. This caused the job to fail. Look at the logs for the task for more details.
2016-08-08T17:30:29.7032002Z ##[error] en Microsoft.TeamFoundation.DistributedTask.Worker.JobRunner.Run(IJobContext jobContext, IJobRequest job, IJobExtension jobExtension, CancellationTokenSource tokenSource)
Fehler in Zeile 29 sind wie folgt:
2016-08-08T17:30:25.7719622Z ##[error]C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\LightSwitch\v3.0\Publish\v1.8\Microsoft.LightSwitch.Publish.targets(31,9): Error MSB4184: La expresión "[System.IO.Path]::Combine(null, bin\x86)" no se puede evaluar. El valor no puede ser nulo. Nombre del parámetro: path1
Auf Englisch bedeutet: Fehler MSB4184: „[System.IO.Path] :: Kombinieren (null, ist \ x86) "Ausdruck kann nicht ausgewertet werden. Der Wert kann nicht Null sein. Parametername: path1
gehen tief in Microsoft.LightSwitch.Publish.Targets Linie 39:
<!--If the path to the sign tool is not set, try the Windows SDK path or the Framework SDK path -->
<_WindowsSDKSignToolPath Condition="'$(SignToolPath)' == ''">$([System.IO.Path]::Combine('$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots', 'KitsRoot', null, RegistryView.Registry32, RegistryView.Default))', 'bin\x86'))</_WindowsSDKSignToolPath>
Projekt Kompilieren mithilfe von Visual Studio 2012 perfekt funktioniert, wirft jedoch Fehler TFS Build OmniMerchant.ls3proj in bezieht sich :
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\LightSwitch\$(LightSwitchVersion)\Microsoft.LightSwitch.targets" />
I HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows Kits \ Installed Roots und KitsRoot Schlüssel in Server erstellt, auch kopierte ich alle Ordner und Dateien Microsoft \ Visualstudio \ Light in Server basierend auf Entwickler-Maschine, aber Fehler st krank zeigt. Bitte, brauche Hilfe! danke
Ich habe einen Warring in Ihrem Log '## [Warnung] Visual Studio Version '11 .0 'nicht gefunden. Suchen Sie nach der neusten Version. 'Hast du auf die richtige Version in deiner Build-Definition hingewiesen? Funktionierte das mit Ihrer lokalen Build-Umgebung auf Build-Agent nicht über TFS? Und versuchen Sie es erneut mit dem Ändern von 'release | any cpu' zu' release | x86' –
Patrick, hallo, ist es erforderlich, Visual Studio 2012 in Build-Server oder einige SDK installiert zu haben? –
Ja, du solltest besser sicherstellen, dass die Umgebung auf deinem Build-Server (Build-Agent) mit deiner lokalen identisch ist. Dies reduziert das Risiko von Build-Fehlern erheblich. Versuchen Sie es erneut, nachdem Sie VS2012 auf Ihrem Build Agent installiert haben. –