On C# Express the answer is simple: none.
C# Express does not support extensions. People have tried before and it has got ugly. Lawyers, mess, everything. The famous example is TestDriven.NET.
If you don't mind building at the command line, you could use an msbuild custom task, or a pre-build / post-build command.
In VS2005/VS2008 ("proper"), a "custom tool" is the one of the ways to go; this involves writing a Package
; I've done this recently, and the code is open for inspection.
T4 is another option going forward. It didn't fit my needs, but it might do yours.
As a quick check of build events, I've added (in an express project) pre-build and post-build events (Project Properties -> Build Events) of:
echo $(TargetPath)
and
echo $(SolutionDir)
respectively; hit build, and the output is now:
------ Build started: Project: ConsoleApplication10, Configuration: Release Any CPU ------
echo D:\SomePath\ConsoleApplication10.exe
D:\SomePath\ConsoleApplication10.exe
c:\WINDOWS\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /unsafe+ /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:TRACE /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /reference:c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Design.dll /reference:c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /reference:c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /debug:pdbonly /filealign:512 /optimize+ /out:obj\Release\ConsoleApplication10.exe /target:exe Form1.cs Form1.Designer.cs Form2.cs Form2.Designer.cs Program.cs Properties\AssemblyInfo.cs
Compile complete -- 0 errors, 0 warnings
ConsoleApplication10 -> D:\SomePath\ConsoleApplication10.exe
echo D:\SomePath
D:\SomePath
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
So it seems to work fine (i.e. both events have been executed). Not elegant, but workable. The macros should allow you (with some pokery) to access project items, for example $(ProjectPath)SomeFile.xml