1
votes

I'm trying to build CI/CD for Azure Data lake analytics - USQL code and when i build the code using Visual studio build option in VSTS getting the below error - Error MSB4019:The imported project "C:\Users\buildguest\AppData\Roaming\Microsoft\DataLake\MsBuild\1.0\Usql.targets" was not found.

My import statements from project file is -

And import build arguments as below - /p:USQLSDKPath=$(Build.SourcesDirectory)/USQLMSBuild/packages/Microsoft.Azure.DataLake.USQL.SDK.1.3.180223/build/runtime /p:USQLTargetType=SyntaxCheck /p:DataRoot=$(Build.SourcesDirectory)

Any help in resolving this issue will be much appreciated

2
Are you using a private or hosted agent?Rodrigo Werlang
I'm using Hosted AgentArunachalam

2 Answers

0
votes

The targets error could indicate that the Data Lake targets are missing on your agent. I suggest you to setup a private agent, install Visual Studio on it and install the Data Lake extensions/components you have installed on your local machine.

0
votes

Refer to these steps below and check the result:

  1. Modify project file:

replace

<Import Project="$(AppData)\Microsoft\DataLake\MsBuild\1.0\Usql.targets" /> 

to

<!-- check for SDK Build target in current path then in USQLSDKPath in the case of command line build -->
  <Import Project="UsqlSDKBuild.targets" Condition="'$(BuildingInsideVisualStudio)' != 'true' And  Exists('UsqlSDKBuild.targets')" />
  <Import Project="$(USQLSDKPath)\UsqlSDKBuild.targets" Condition="'$(BuildingInsideVisualStudio)' != 'true' And !Exists('UsqlSDKBuild.targets') And '$(USQLSDKPath)' != '' And Exists('$(USQLSDKPath)\UsqlSDKBuild.targets')" />
  <!-- backward compatible with IDE build -->
  <Import Project="$(AppData)\Microsoft\DataLake\MsBuild\1.0\Usql.targets" Condition="'$(BuildingInsideVisualStudio)' == 'true'" />
  1. Install Microsoft.Azure.Datalake.USQL.SDK package
  2. Specify MSBuild Arguments like this: /p:USQLSDKPath=$(Build.SourcesDirectory)/USQLMSBuild/packages/Microsoft.Azure.DataLake.USQL.SDK.1.3.1019-preview/build/runtime /p:USQLTargetType=SyntaxCheck /p:DataRoot=$(Build.SourcesDirectory) (per to actual path)

More information: Continuous integration made easy with MSBuild support for U-SQL (preview)