I suggest you dump the modules and types from the loaded assemblies to a log file at appropriate times. You can then look for the mystery assembly and find the types in it. For example:
using System;
using System.Xml.Linq;
public class Test
{
static void Main()
{
Console.WriteLine("Before");
DumpAssemblies();
DoSomethingWithXml();
Console.WriteLine("After");
DumpAssemblies();
}
static void DoSomethingWithXml()
{
new XDocument();
}
static void DumpAssemblies()
{
Console.WriteLine("Assemblies loaded:");
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
{
Console.WriteLine(" Assembly {0}:", assembly.FullName);
foreach (var module in assembly.GetModules())
{
Console.WriteLine(" Module {0}:", module.Name);
foreach (var type in module.GetTypes())
{
Console.WriteLine(" {0}", type.FullName);
}
}
}
}
}
Once you know which types are in which assemblies, that should probably explain what's going on. If you see the mystery modules without any types, or with types which don't make much sense, you'll need to add more diagnostics - e.g. listing resources within the modules, or methods within the types etc.