Search code examples
msbuildazure-devopsazure-data-lakeu-sql

Error MSB4057: The target "Build" does not exist in the project working with Continuous integration with MSbuild for U-SQL


I am working with integrating continous integration with vsts using MSBuild for U-SQL reffering the link : https://blogs.msdn.microsoft.com/azuredatalake/2017/10/24/continuous-integration-made-easy-with-msbuild-support-for-u-sql-preview/

But i am facing below issue while working with VSTS Build server

Source\TrainingUsql\TrainingUsql\TrainingUsql\TrainingUsql.usqlproj (0, 0)
Source\TrainingUsql\TrainingUsql\TrainingUsql\TrainingUsql.usqlproj(0,0): Error MSB4057: The target "Build" does not exist in the project.
Process 'msbuild.exe' exited with code '1'.

I have followed all the steps given in link and added the below MSBuild argument :

/p:USQLSDKPath=$(Build.SourcesDirectory)/USQLMSBuild/packages/Microsoft.Azure.DataLake.USQL.SDK.1.3.1019-preview/build/runtime /p:USQLTargetType=SyntaxCheck /p:DataRoot=$(Build.SourcesDirectory)

Any help would be appreciated.


Solution

  • I can build successful. Below is my settings and build logs for your reference:

    enter image description here

    enter image description here

    ******************************************************************************
    Finishing: NuGet restore
    ******************************************************************************
    Evaluating condition for step: 'Build solution USQLDemoProject/USQLDemoProject.sln'
    Evaluating: succeeded()
    Evaluating succeeded:
    => (Boolean) True
    Expanded: True
    Result: True
    ******************************************************************************
    Starting: Build solution USQLDemoProject/USQLDemoProject.sln
    ******************************************************************************
    ==============================================================================
    Task         : Visual Studio Build
    Description  : Build with MSBuild and set the Visual Studio version property
    Version      : 1.120.0
    Author       : Microsoft Corporation
    Help         : [More Information](https://go.microsoft.com/fwlink/?LinkID=613727)
    ==============================================================================
    VstsTaskSdk 0.8.2 commit
    Entering D:\marina\newTFSPCagent\_work\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.120.0\VSBuild.ps1.
    Loading resource strings from: D:\marina\newTFSPCagent\_work\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.120.0\Task.json
    Loaded 8 strings.
    SYSTEM_CULTURE: 'en-US'
    Loading resource strings from: D:\marina\newTFSPCagent\_work\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.120.0\Strings\resources.resjson\en-US\resources.resjson
    Loaded 8 strings.
    INPUT_VSVERSION: '14.0'
    INPUT_MSBUILDARCHITECTURE: 'x86'
    INPUT_MSBUILDARGS: '/p:USQLSDKPath=D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\packages\Microsoft.Azure.DataLake.USQL.SDK.1.3.1019-preview\build\runtime;USQLTargetType=SyntaxCheck;DataRoot=D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject'
    INPUT_SOLUTION: 'D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\USQLDemoProject.sln'
    INPUT_PLATFORM: 'any cpu'
    INPUT_CONFIGURATION: 'release'
    INPUT_CLEAN: 'false'
    Converted to bool: False
    INPUT_MAXIMUMCPUCOUNT: 'false'
    Converted to bool: False
    INPUT_RESTORENUGETPACKAGES: 'false'
    Converted to bool: False
    INPUT_LOGPROJECTEVENTS: 'false'
    Converted to bool: False
    INPUT_CREATELOGFILE: 'false'
    Converted to bool: False
    INPUT_VSLOCATION (empty)
    INPUT_MSBUILDLOCATION (empty)
    INPUT_MSBUILDVERSION (empty)
    Loading module from path 'D:\marina\newTFSPCagent\_work\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.120.0\ps_modules\MSBuildHelpers\MSBuildHelpers.psm1'.
    Loading resource strings from: D:\marina\newTFSPCagent\_work\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.120.0\ps_modules\MSBuildHelpers\module.json
    Loaded 9 strings.
    SYSTEM_CULTURE: 'en-US'
    Loading resource strings from: D:\marina\newTFSPCagent\_work\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.120.0\ps_modules\MSBuildHelpers\Strings\resources.resjson\en-US\resources.resjson
    Loaded 9 strings.
    Exporting function 'Format-MSBuildArguments'.
    Exporting function 'Invoke-BuildTools'.
    Exporting function 'Get-MSBuildPath'.
    Exporting function 'Get-SolutionFiles'.
    Exporting function 'Get-VisualStudio_15_0'.
    Exporting function 'Select-MSBuildPath'.
    Importing function 'Format-MSBuildArguments'.
    Importing function 'Get-MSBuildPath'.
    Importing function 'Get-SolutionFiles'.
    Importing function 'Get-VisualStudio_15_0'.
    Importing function 'Invoke-BuildTools'.
    Importing function 'Select-MSBuildPath'.
    Entering Get-SolutionFiles.
    Solution: 'D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\USQLDemoProject.sln'
    Leaving Get-SolutionFiles.
    Entering Select-VSVersion.
    PreferredVersion: '14.0'
    Entering Get-VSPath.
    Version: '14.0'
    Leaving Get-VSPath.
    Leaving Select-VSVersion.
    Entering Select-MSBuildPath.
    PreferredVersion: '14.0'
    Architecture: 'x86'
    Defaulted MSBuild location method to: version
    Entering Get-MSBuildPath.
    Version: '14.0'
    Architecture: 'x86'
    Loading Microsoft.Build.Utilities.Core, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
    Not found.
    Loading Microsoft.Build.Utilities.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
    MSBuild: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe
    Leaving Get-MSBuildPath.
    Leaving Select-MSBuildPath.
    Entering Format-MSBuildArguments.
    MSBuildArguments: '/p:USQLSDKPath=D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\packages\Microsoft.Azure.DataLake.USQL.SDK.1.3.1019-preview\build\runtime;USQLTargetType=SyntaxCheck;DataRoot=D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject'
    Platform: 'any cpu'
    Configuration: 'release'
    VSVersion: '14.0'
    MaximumCpuCount: 'False'
    AZURE_HTTP_USER_AGENT: 'VSTS_fc52d179-f3fd-460b-adb1-5ac84bd0e765_build_40_1819'
    Leaving Format-MSBuildArguments.
    Entering Invoke-BuildTools.
    NuGetRestore: 'False'
    SolutionFiles: 'D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\USQLDemoProject.sln'
    MSBuildLocation: 'C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe'
    MSBuildArguments: '/p:USQLSDKPath=D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\packages\Microsoft.Azure.DataLake.USQL.SDK.1.3.1019-preview\build\runtime;USQLTargetType=SyntaxCheck;DataRoot=D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject /p:platform="any cpu" /p:configuration="release" /p:VisualStudioVersion="14.0" /p:_MSDeployUserAgent="VSTS_fc52d179-f3fd-460b-adb1-5ac84bd0e765_build_40_1819"'
    Clean: 'False'
    NoTimelineLogger: 'True'
    CreateLogFile: 'False'
    Entering Invoke-MSBuild.
    ProjectFile: 'D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\USQLDemoProject.sln'
    MSBuildPath: 'C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe'
    AdditionalArguments: '/p:USQLSDKPath=D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\packages\Microsoft.Azure.DataLake.USQL.SDK.1.3.1019-preview\build\runtime;USQLTargetType=SyntaxCheck;DataRoot=D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject /p:platform="any cpu" /p:configuration="release" /p:VisualStudioVersion="14.0" /p:_MSDeployUserAgent="VSTS_fc52d179-f3fd-460b-adb1-5ac84bd0e765_build_40_1819"'
    NoTimelineLogger: 'True'
    Asserting leaf path exists: 'C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe'
    Asserting leaf path exists: 'D:\marina\newTFSPCagent\_work\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.120.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll'
    Entering Invoke-VstsTool.
    FileName: 'C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe'
    Arguments: '"D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\USQLDemoProject.sln" /nologo /nr:false /dl:CentralLogger,"D:\marina\newTFSPCagent\_work\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.120.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=|SolutionDir=D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject"*ForwardingLogger,"D:\marina\newTFSPCagent\_work\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.120.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /p:USQLSDKPath=D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\packages\Microsoft.Azure.DataLake.USQL.SDK.1.3.1019-preview\build\runtime;USQLTargetType=SyntaxCheck;DataRoot=D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject /p:platform="any cpu" /p:configuration="release" /p:VisualStudioVersion="14.0" /p:_MSDeployUserAgent="VSTS_fc52d179-f3fd-460b-adb1-5ac84bd0e765_build_40_1819"'
    RequireExitCodeZero: 'True'
    "C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe" "D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\USQLDemoProject.sln" /nologo /nr:false /dl:CentralLogger,"D:\marina\newTFSPCagent\_work\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.120.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=|SolutionDir=D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject"*ForwardingLogger,"D:\marina\newTFSPCagent\_work\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.120.0\ps_modules\MSBuildHelpers\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /p:USQLSDKPath=D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\packages\Microsoft.Azure.DataLake.USQL.SDK.1.3.1019-preview\build\runtime;USQLTargetType=SyntaxCheck;DataRoot=D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject /p:platform="any cpu" /p:configuration="release" /p:VisualStudioVersion="14.0" /p:_MSDeployUserAgent="VSTS_fc52d179-f3fd-460b-adb1-5ac84bd0e765_build_40_1819"
    Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
    Build started 10/30/2017 3:33:02 PM.
    Project "D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\USQLDemoProject.sln" on node 1 (default targets).
    ValidateSolutionConfiguration:
      Building solution configuration "release|any cpu".
    Project "D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\USQLDemoProject.sln" (1) is building "D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\USQLDemoProject\USQLDemoProject.usqlproj" (2) on node 1 (default targets).
    PrepareForBuild:
      Creating directory "bin\Release\".
      Creating directory "obj\Release\".
    USqlCompilerTarget:
      Building Script: 
      Build All Scripts in 'USQLDemoProject.usqlproj' ...
      Building 'Script.usql' ...
      D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\packages\Microsoft.Azure.DataLake.USQL.SDK.1.3.1019-preview\build\runtime\LocalRunHelper.exe compile -Shallow -FlatDir -Script "D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\USQLDemoProject\bin\Release\Script\Script.usql" -WorkDir "D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\USQLDemoProject\bin\Release\Script" -DataRoot "D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject" -Temp "D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\USQLDemoProject\bin\Release\Script\_TMP" -DumpCommonResult "D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\USQLDemoProject\bin\Release\Script\Script.usql.comresult" -DumpResult "D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\USQLDemoProject\bin\Release\Script\Script.usql.xml"  -SkipInputCheck
      Build suceeded
    CoreCompile:
    Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.
    CopyFilesToOutputDirectory:
      Copying file from "obj\Release\Algebra.xml" to "bin\Release\Algebra.xml".
      USQLDemoProject -> D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\USQLDemoProject\bin\Release\Algebra.xml
    Done Building Project "D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\USQLDemoProject\USQLDemoProject.usqlproj" (default targets).
    Project "D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\USQLDemoProject.sln" (1) is building "D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\ConsoleApp1\ConsoleApp1.csproj" (3) on node 1 (default targets).
    PrepareForBuild:
      Creating directory "bin\Release\".
      Creating directory "obj\Release\".
    GenerateBindingRedirects:
      No suggested binding redirects from ResolveAssemblyReferences.
    CoreCompile:
      C:\Program Files (x86)\MSBuild\14.0\bin\csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /platform:anycpu32bitpreferred /errorreport:prompt /warn:4 /define:TRACE /highentropyva+ /reference:D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\packages\Microsoft.Azure.DataLake.USQL.SDK.1.3.1019-preview\lib\net45\Microsoft.Analytics.Diagnostics.dll /reference:D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\packages\Microsoft.Azure.DataLake.USQL.SDK.1.3.1019-preview\lib\net45\Microsoft.Analytics.Interfaces.dll /reference:D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\packages\Microsoft.Azure.DataLake.USQL.SDK.1.3.1019-preview\lib\net45\Microsoft.Analytics.Interfaces.Streaming.dll /reference:D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\packages\Microsoft.Azure.DataLake.USQL.SDK.1.3.1019-preview\lib\net45\Microsoft.Analytics.Types.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\Microsoft.CSharp.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\M...
      Using shared compilation with compiler from directory: C:\Program Files (x86)\MSBuild\14.0\bin
    _CopyFilesMarkedCopyLocal:
      Copying file from "D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\packages\Microsoft.Azure.DataLake.USQL.SDK.1.3.1019-preview\lib\net45\Microsoft.Analytics.Diagnostics.dll" to "bin\Release\Microsoft.Analytics.Diagnostics.dll".
      Copying file from "D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\packages\Microsoft.Azure.DataLake.USQL.SDK.1.3.1019-preview\lib\net45\Microsoft.Analytics.Interfaces.dll" to "bin\Release\Microsoft.Analytics.Interfaces.dll".
      Copying file from "D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\packages\Microsoft.Azure.DataLake.USQL.SDK.1.3.1019-preview\lib\net45\Microsoft.Analytics.Interfaces.Streaming.dll" to "bin\Release\Microsoft.Analytics.Interfaces.Streaming.dll".
      Copying file from "D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\packages\Microsoft.Azure.DataLake.USQL.SDK.1.3.1019-preview\lib\net45\Microsoft.Analytics.Types.dll" to "bin\Release\Microsoft.Analytics.Types.dll".
    _CopyAppConfigFile:
      Copying file from "App.config" to "bin\Release\ConsoleApp1.exe.config".
    CopyFilesToOutputDirectory:
      Copying file from "obj\Release\ConsoleApp1.exe" to "bin\Release\ConsoleApp1.exe".
      ConsoleApp1 -> D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\ConsoleApp1\bin\Release\ConsoleApp1.exe
      Copying file from "obj\Release\ConsoleApp1.pdb" to "bin\Release\ConsoleApp1.pdb".
    Done Building Project "D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\ConsoleApp1\ConsoleApp1.csproj" (default targets).
    Done Building Project "D:\marina\newTFSPCagent\_work\8\s\USQLDemoProject\USQLDemoProject.sln" (default targets).
    Build succeeded.
        0 Warning(s)
        0 Error(s)
    Time Elapsed 00:00:07.24
    Exit code: 0
    Leaving Invoke-VstsTool.
    Leaving Invoke-MSBuild.
    Leaving Invoke-BuildTools.
    Leaving D:\marina\newTFSPCagent\_work\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.120.0\VSBuild.ps1.
    ******************************************************************************
    Finishing: Build solution USQLDemoProject/USQLDemoProject.sln