我正在尝试为Azure Data湖分析构建CI / CD - USQL代码,当我在VSTS中使用Visual Studio构建选项构建代码时出现以下错误 - 错误MSB4019:导入的项目“C:\ Users \未找到buildguest \ AppData \ Roaming \ Microsoft \ DataLake \ MsBuild \ 1.0 \ Usql.targets。
项目文件中的导入语句是 -
并导入构建参数如下 - /p:USQLSDKPath=$(Build.SourcesDirectory)/USQLMSBuild/packages/Microsoft.Azure.DataLake.USQL.SDK.1.3.180223/build/runtime / p:USQLTargetType = SyntaxCheck /p:DataRoot=$(Build.SourcesDirectory)
非常感谢任何解决此问题的帮助
答案 0 :(得分:0)
目标错误可能表示您的代理上缺少Data Lake目标。我建议您设置一个私有代理,在其上安装Visual Studio并安装您在本地计算机上安装的Data Lake扩展/组件。
答案 1 :(得分:0)
请参阅以下步骤并检查结果:
替换
<Import Project="$(AppData)\Microsoft\DataLake\MsBuild\1.0\Usql.targets" />
到
<!-- 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'" />
/p:USQLSDKPath=$(Build.SourcesDirectory)/USQLMSBuild/packages/Microsoft.Azure.DataLake.USQL.SDK.1.3.1019-preview/build/runtime /p:USQLTargetType=SyntaxCheck /p:DataRoot=$(Build.SourcesDirectory)
(每个实际路径)更多信息:Continuous integration made easy with MSBuild support for U-SQL (preview)