I use machine.config for not just ASP.NET, but for overall config as well. I implemented a hash algorithm (Tiger) in C# and wanted it to be available via machine request. So, registered my assembly in the GAC and added the following to machine.config:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<mscorlib>
<cryptographySettings>
<cryptoNameMapping>
<cryptoClasses>
<cryptoClass Tiger192="Jcs.Tiger.Tiger192, Jcs.Tiger, Culture=neutral, PublicKeyToken=66c61a8173417e64, Version=1.0.0.4"/>
<cryptoClass Tiger160="Jcs.Tiger.Tiger160, Jcs.Tiger, Culture=neutral, PublicKeyToken=66c61a8173417e64, Version=1.0.0.4"/>
<cryptoClass Tiger128="Jcs.Tiger.Tiger128, Jcs.Tiger, Culture=neutral, PublicKeyToken=66c61a8173417e64, Version=1.0.0.4"/>
</cryptoClasses>
<nameEntry name="Tiger" class="Tiger192"/>
<nameEntry name="TigerFull" class="Tiger192"/>
<nameEntry name="Tiger192" class="Tiger192"/>
<nameEntry name="Tiger160" class="Tiger160"/>
<nameEntry name="Tiger128" class="Tiger128"/>
<nameEntry name="System.Security.Cryptography.HashAlgorithm" class="Tiger192"/>
</cryptoNameMapping>
<oidMap>
<oidEntry OID="1.3.6.1.4.1.11591.12.2" name="Jcs.Tiger.Tiger192"/>
</oidMap>
</cryptographySettings>
</mscorlib>
</configuration>
This allows my code to look like so:
using (var h1 = HashAlgorithm.Create("Tiger192"))
{
...
}
and there's no dependency on the Jcs.Tiger.dll assembly in my code at all, hard or soft.