admin管理员组文章数量:1123593
We are using a Database Project which contains all the database objects that make up our data warehouse. Our code is stored in Azure DevOps, and we have CI/CD processes in place in there as well. Part of that is an MSBuild task that attempts to build the project whenever a pull request is created, and this has been working fine in the past.
We switched to using Azure Data Studio (ADS) for maintaining our project. ADS prompted that it required some updates to the project file, so we added those lines to the project. Within Azure Data Studio, we can build the solution just fine, allowing us to verify we have a working solution without errors and/or warnings.
However, when we created a PR, we ended up getting an error:
Error MSB4057: The target "Build" does not exist in the project
Some searching and trying a few different things caused me to figure out that if I include the following line, DevOps will build the project just fine:
<Import Condition="'$(SQLDBExtensionsRefPath)' == ''" Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
Our problem is that when we then are unable to build the project in Azure Data Studio, where it throws the following error:
error MSB4278: The imported file "$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" does not exist and appears to be part of a Visual Studio component. This file may require MSBuild.exe in order to be imported successfully, and so may fail to build in the dotnet CLI.
I'm currently side-stepping the issue by manually commenting this line in Data Studio, building locally, then uncommenting the line prior to committing my change when I'm ready for the PR. This is not a desirable long-term solution, though.
What I've tried so far:
- Disabled the MSBuild task and added a Visual Studio Build task using the same parameters in the pipeline. This did nothing and the same error as above is thrown.
- Attempted to add
/p:NetCoreBuild=true
to the MSBuild Arguments in the DevOps pipeline. This also did nothing. - Tried removing the initial new lines added by Azure Data Studio and building the project in Visual Studio. This also threw an error (though I will admit I spent most of my day dealing with resolving issues, so perhaps I ought to give this anotyher go now our overall solution is a bit more clean).
I'm basically hoping someone happened to go through this process before, and managed to find a solution. At this stage I went through about a dozen links to reach this situation, and I'm afraid I might have lost track of how to actually reproduce this situation in case I'd want to reproduce this in a clean new branch.
本文标签:
版权声明:本文标题:Database Project to Azure DevOps - Error MSB4057: The target "Build" does not exist in the project - Stack Ove 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736562936a1944668.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论