是否有任何事件可以在构建过程中触发 [英] Is there any event which can be fired during build process

查看:71
本文介绍了是否有任何事件可以在构建过程中触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨专家,



我有一些c#代码块,我想在项目的构建过程中运行。

我在网络中有任何事件可以在构建过程中被触发吗?

或者在构建过程中是否还有其他方法来运行代码。



提前感谢

Keerthi Kumar

Hi experts,

I have some block of c# code which i want to run during build process of the project.
I there any event in dot net which can be fired during build process?
Or Is there any other way to run the code during build process.

thanks in advance
Keerthi Kumar

推荐答案

是的,你可以,但这不是关于事件。它是关于MSBuild声明性语言,它定义了具有依赖关系和时间戳的增量构建。您可以使用自定义任务创建自定义项目,符合MSBuild标准。 C#非常适合编程这样的任务。从本质上讲,这是一个使用MSBuild API的.NET类库程序集。



请从这里开始:

https://msdn.microsoft.com/en-us/library/dd393574.aspx [ https://msdn.microsoft.com/en-us/library/dd637714.aspx [ ^ ],

https://msdn.microsoft.com/en-us/library/ms171466.aspx [ ^ ],

https://msdn.microsoft.com/en-us/library/t9883dzc.aspx [<一个HREF =HTTPS://msdn.mi crosoft.com/en-us/library/t9883dzc.aspx\"target =_ blanktitle =新窗口> ^ ]。



见我对解决方案1的评论。



-SA
Yes, you can, but this is not about event. It's about MSBuild declarative language which defines incremental build with dependencies and time stamps. You can create custom projects using custom Tasks, conforming to the MSBuild standard. C# is quite suitable for programming such tasks. Essentially, this is a .NET class library assembly using MSBuild API.

Please start here:
https://msdn.microsoft.com/en-us/library/dd393574.aspx[^],
https://msdn.microsoft.com/en-us/library/dd637714.aspx[^],
https://msdn.microsoft.com/en-us/library/ms171466.aspx[^],
https://msdn.microsoft.com/en-us/library/t9883dzc.aspx[^].

See also my comment to Solution 1.

—SA


这篇关于是否有任何事件可以在构建过程中触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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