using System;
using System.Reflection;
using slang.Compiler.Clr.Compilation.Definitions;

namespace slang.Tests.IL
{

    static class AssemblyDefinitionExtensions
    {
        public static Type [] GetTypes (this AssemblyDefinition assemblyDefinition)
        {
            return assemblyDefinition.LoadAssembly ().GetTypes ();
        }

        public static Assembly LoadAssembly (this AssemblyDefinition assemblyDefinition)
        {
            return AppDomain.CurrentDomain.Load (new AssemblyName (assemblyDefinition.Name));
        }
    }    
}

﻿using System;
using System.Reflection;
using slang.Compiler.Clr.Compilation.Definitions;

namespace slang.Tests.IL
{

    static class AssemblyDefinitionExtensions
    {
        public static Type [] GetTypes (this AssemblyDefinition assemblyDefinition)
        {
            return assemblyDefinition.LoadAssembly ().GetTypes ();
        }

        public static Assembly LoadAssembly (this AssemblyDefinition assemblyDefinition)
        {
            throw new InvalidOperationException("We will no longer be loading dynamic assemblies for disk so this operation is no longer possible.");
        }
    }    
}

Stop loading dynamic modules from disk
Stop loading dynamic modules from disk

We are not able to load dynamically defined modules from disk because we
are not able to save them to disk in the first place.

For the moment I've decided to throw an invalid operation exception and
deal with the fallout at a later stage.
