Rash thoughts about .NET, C#, F# and Dynamics NAV.


"Every solution will only lead to new problems."

Tuesday, 14. April 2009


Writing custom C# tasks for “FAKE – F# Make”

Filed under: C#,F#,FAKE - F# Make — Steffen Forkmann at 15:37 Uhr

“FAKE – F# Make” is intended to be an extensible build framework. That’s why I tried to make it as easy as possible to create custom tasks. This posts shows how we can create a (very simple) custom task in C# which gives a random number.

Open Visual Studio and create a new C# class library called my MyCustomTask and create a class called RandomNumberTask:

Now compile this project and put the generated assembly into the tools/FAKE path of your project. Now you can use your CustomTask in the build script:

You can use every .Net class with FAKE. Just put the assembly in the right folder (tools/FAKE) and include it with the #r command.

If you want to use FAKE’s standard functionality (like globbing) within your CustomTask project, just reference FakeLib.dll and explore the FAKE namespace.

Tags: , , , ,

No Comments »

No comments yet.

RSS feed for comments on this post. | TrackBack URI

Leave a comment

XHTML ( You can use these tags): <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .