private void TryToLoadTypeIfApplicable(String typeName, String assemblyName)
{
if (!LoadTypes)
return;
Assembly asm = Assembly.Load(assemblyName);
if (asm == null)
{
throw new RemotingException(
String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Remoting_AssemblyLoadFailed"),
assemblyName));
}
Type type = asm.GetType(typeName, false, false);
if (type == null)
{
throw new RemotingException(
String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Remoting_BadType"),
typeName));
}
}