Lawrence Wagerfield
Lawrence Wagerfield

Reputation: 6621

Receiving Events at Compile-Time?

How do you execute custom code at compile time? Is there an attribute you can use to markup a static method which is then executed on each build?

I'm pretty certain libraries like PostSharp and Moles do something like this. Each of these appear to execute special compile-time routines for the projects they are referenced by.

EDIT: I am referring to the type of compilation done by visual studio, not JIT.

Upvotes: 0

Views: 235

Answers (1)

Reed Copsey
Reed Copsey

Reputation: 564901

Many tools use Custom Build Events to handle updating and manipulating the build process. This is a fairly simple technique that can be used to put your own logic into the build process.

This doesn't look at your code -but you can write a program that uses reflection to analyze the assemblies post-build and do some logic.

Upvotes: 1

Related Questions