从构建事件中调用方法 [英] Call a method from a build event

查看:75
本文介绍了从构建事件中调用方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过postbuild事件进行方法调用?

is it possible to make a method call from a postbuild event?

namespace Test
{
    public class MyClass
    {
        public void DoSomething()
        {
            // Do something
        }
     }
}

当然,此类位于我指定其构建事件的项目中.有没有一种方法可以将DoSomething称为后构建事件?

Of course this class resides in a project whose build events I specify. Is there a way to call DoSomething as a postbuild event?

推荐答案

您不能直接执行此操作,但是可以在解决方案中包含一个小的可执行文件,并引用要调用的方法.

You can't do this directly, but you could include a small executable as part of your solution, with a reference to the method you want to call.

解决方案构建完成后,触发它以触发刚刚编译的可执行文件,并且您应该在那里.

Once the solution builds, trigger it to fire the executable you just compiled and you should be there.

这篇关于从构建事件中调用方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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