6

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

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

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

Mefhisto1
  • 2,188
  • 7
  • 34
  • 73
  • 3
    Not really, no; unless you package one of your projects as an exe, or use powershell to load and invoke from an assembly... – Marc Gravell Feb 11 '15 at 12:36
  • @MarcGravell: Powershell is the other idea I thought of - just no idea how to use it properly :( – Ian Feb 11 '15 at 12:40

1 Answers1

6

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.

Ian
  • 33,605
  • 26
  • 118
  • 198