sqlproj的自定义生成操作 [英] Custom Build Action for sqlproj

查看:163
本文介绍了sqlproj的自定义生成操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了本文,其中会将自定义的生成操作"选项添加到csproj的属性窗口中.但是,我想为数据库项目中的对象提供一个自定义的构建动作.是否可以添加到.sqlproj文件中以执行类似操作?我可以为SQL添加一个自定义生成操作吗?

I came across this article which will add a custom "Build Action" option to the properties window for csproj. However, I would like to have a custom Build Action for the objects in a database project. Is there something I can add to the .sqlproj file that can do something similar? Can I add a custom Build Action at all for SQL?

推荐答案

您可以编辑sqlproj文件并向其中添加自己的msbuild目标.等同于post \ pre-build操作.

You can edit sqlproj file and add your own msbuild target to it. It'll be equal to post\pre-build action.

已编辑: .SQLProj文件实际上是MSBuild脚本文件(如果我们都在谈论SSDT SQL数据库项目1 :).因此,您可以在任何文本编辑器中将其打开并添加如下内容:

Edited: .SQLProj file is actually MSBuild script file (if we are both talking about SSDT SQL Database project one :)). So you can open it in any text editor and add something like this:

<Target Name="PreBuildEvent" AfterTargets="PrepareForBuild">
    <Exec WorkingDirectory="$(OutDir)" Command="calc.exe" />
</Target>

这将非常类似于执行PreBuild命令以构建过程的方式. 检查在构建过程中是否正在调用PrepareForBuild目标,或将其更改为所需的任何其他目标.您可以进一步扩展并使用所需的任何msbuild任务扩展构建过程.

It'll be very close to the way how PreBuild command being executed to build process. Check that PrepareForBuild target is being called during your build process or change it to any other you want. You can go further and extend your build process with any msbuild tasks you want.

这篇关于sqlproj的自定义生成操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆