Compiling Resources using Nant

In: C#|NAnt

24 Sep 2010

Including an embedded resource into your Nant script is not difficult at all.

Simply add a resources tag and include the Full Namespace. Note that you will also need to include /Path/To/Resource/File.resx in the include if you don’t have the resource file under the root folder of your library.

Here’s a working example.

1
2
3
4
5
6
7
8
9
10
11
12
<csc target="library" output="../bin/Domain.dll" doc="../bin/Domain.dll.xml" debug="${debug}" warnaserror="true">
     <sources>
	<include name="**.cs" />
     </sources>
     <references>
          <include name="System.Configuration.dll" />
          <!-- other includes removed for brevity -->
      </references>
      <resources prefix="Domain.Tests.Resource">
        <include name="Tests/Resource/TestFixtureResource.resx" />
      </resources>
</csc>

Comment Form

About Justin

justin

Justin is a Senior Software Engineer living in Brisbane. A Polyglot Developer proficient in multiple programming languages including [C#, C/C++, Java, Android, Ruby..]. He's currently taking an active interest in Teaching Kids to Code, Functional Programming, Robotics, 3D Printers, RC Quad-Copters and Augmented Reality.

About This Blog

Software Engineering is an art form, a tricky art form that takes as much raw talent as it does technical know how. I'll be posting articles on professional tips and tricks, dos and donts, and tutorials.

profile for Justin Shield on Stack Exchange, a network of free, community-driven Q&A sites

Photostream

  • What I look for in a senior software engineer Justin Shield: […] I’m not going to list the design patterns that you’ll need, I’ve already [...]
  • Justin: Hi Ross, I do actually like Umbraco, it provides some nice abilities for creating websites that I [...]
  • Justin: Hi GordonBGood, Thanks for taking the time in replying. You're absolutely correct, it is turners s [...]
  • Ross Gallagher: Hi Justin, I'm a fellow Aussi looking to use Umbraco to create a simple website. I have downloaded [...]
  • GordonBGood: This is the "Turner Sieve" which **IS NOT** the Sieve of Eratosthenes (SoE) neither by algorithm nor [...]