To compile the Nuclex Framework, you'll need XNA Game Studio 4.0 and either the full Visual Studio 2010 or
Visual C# 2010 Express and Visual C++ 2010 Express
. Visual C++ is only required if you intend to use Vector Font rendering.
Set Up a Strong Name Key
.NET assemblies can signed with a strong name
. Basically it's a tag saying "I made this" that's nearly impossible to falsify. This prevents anyone from modifying the assemblies or from substituting them with other assemblies - unless
he's in possession of the right strong name key
.snk) to sign the builds. The Nuclex Framework assemblies are signed with a strong name, but of course I don't distribute my
.snk file with the source release (otherwise, anyone could recompile the sources and claim for it to be an official build). You'll have to provide your own .snk file before you can compile.
- If you already have a strong name key, just copy it into the source release as Foundation\Foundation.snk and Framework\Framework.snk
- If you don't have one yet, open a Visual Studio 2010 Command Prompt and type:
sn -k MyKey.snk, then copy it into the source release as described above.
If you intend to use Vector Font rendering, you'll also have to replace the public key token in the TrueTypeImporter. To do so, open a Visual Studio 2010 Command Prompt and run:
- sn -p MyKey.snk MyKey.publickey
- sn -t MyKey.publickey
This will display the public key token to you (it looks like this:
). Paste this public key token into the sources at
(there are two lines per file, saying "PublicKeyToken=96bb577564343f16" which you'll need to change to point to your own public
There are two packages the Nuclex Framework consists of: Foundation and Framework. Foundation contains general-purpose assemblies that don't have any dependency on XNA (for example, Nuclex.Support, my library of extension methods and utility classes), Framework
sits on top of Foundation and contains the XNA game development stuff.
With the strong name keys in place, this it pretty straightforward. Open the Solution file for the platform you wish to compile (for example, xna-4.0-x86 for the XNA 4.0 Windows build) in Visual Studio and hit compile!
If you switch between platforms, sometimes Visual Studio will not detect that it needs to run certain assets through the content pipeline again and you will end up with .xnbs (compiled assets) for the wrong platform being embedded in the binaries. The safest
way to force a rebuild in this case is to remove the bin\EmbeddedContent directories from all projects (a 'Rebuild All' doesn't help because it doesn't touch those). NAnt users can just type
in the project's root directory to do this.