<p>I'm writing a tool to report information about .NET applications deployed across environments and regions within my client's systems.</p>

<p>I'd like to read the values of assembly attributes in these assemblies.</p>

<p>This can be achieved using <code>Assembly.ReflectionOnlyLoad</code>, however even this approach keeps the assembly loaded.  The issue here is that I cannot load two assemblies that have the same name from different paths, so naturally I can't compare the same application deployed in different systems.</p>

<p>At this point I'm assuming the solution will involve using temporary <code>AppDomain</code>s.</p>

<p>Can someone detail how to load an assembly into another <code>AppDomain</code>, read the attributes from it and then unload the <code>AppDomain</code>?</p>

<p>This needs to work for assemblies on the file system as well as those at URL addresses.</p>

From the
MSDN documentation of System.Reflection.Assembly.ReflectionOnlyLoad (String)
:
The reflection-only context is no
  different from other contexts.
  Assemblies that are loaded into the
  context can be unloaded only by
  unloading the application domain.
So, I am afraid the only way to unload an assembly is unloading the application domain.
To create a new AppDomain and load assemblies into it:
```
```
public void TempLoadAssembly()
{
    AppDomain tempDomain = AppDomain.CreateDomain("TemporaryAppDomain");
    tempDomain.DoCallBack(LoaderCallback);
    AppDomain.Unload(tempDomain);
}

private void LoaderCallback()
{
    Assembly.ReflectionOnlyLoad("YourAssembly");
    // Do your stuff here
}
```
```