static DynamicAssemblyManager()
        {
#if !SILVERLIGHT
            assemblyName = new AssemblyName("NLiteDynamicAssembly");
            assemblyBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(
                assemblyName,
                AssemblyBuilderAccess.RunAndSave
                );

            moduleBuilder = assemblyBuilder.DefineDynamicModule(
                assemblyName.Name,
                assemblyName.Name + ".dll",
                true);

            Module = assemblyBuilder.GetModules().FirstOrDefault();
           
#else
            assemblyName = new AssemblyName("EmitMapperAssembly.SL");
            assemblyBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(
                  assemblyName,
                  AssemblyBuilderAccess.Run
                  );
            moduleBuilder = assemblyBuilder.DefineDynamicModule(assemblyName.Name, true);
#endif
        }
        static DynamicAssemblyManager()
        {
            assemblyName = new AssemblyName("EagleDynamicAssembly");
            assemblyBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(
                assemblyName,
                AssemblyBuilderAccess.RunAndSave
                );

            moduleBuilder = assemblyBuilder.DefineDynamicModule(
                assemblyName.Name,
                assemblyName.Name + ".dll",
                true);

            Module = assemblyBuilder.GetModules().FirstOrDefault();
        }
	public void ManifestModule ()
	{
		AssemblyName aname = new AssemblyName ("ManifestModule1");
		ab = domain.DefineDynamicAssembly (aname, AssemblyBuilderAccess.RunAndSave,
			tempDir);
		Assert.IsNotNull (ab.ManifestModule, "#A1");
		Assert.AreEqual (1, ab.GetModules ().Length, "#A2");
		Assert.AreEqual (typeof (ModuleBuilder), ab.ManifestModule.GetType (), "#A3");

		ModuleBuilder mb1 = (ModuleBuilder) ab.ManifestModule;
		Assert.AreSame (mb1, ab.GetModules () [0], "#B1");
		Assert.IsFalse (mb1.IsResource (), "#B2");
		Assert.AreSame (mb1, ab.ManifestModule, "#B3");

		ab.Save ("ManifestModule.dll");

		ModuleBuilder mb2 = (ModuleBuilder) ab.ManifestModule;
		Assert.AreSame (mb2, ab.GetModules () [0], "#C1");
		Assert.IsFalse (mb2.IsResource (), "#C2");
		Assert.AreSame (mb2, ab.ManifestModule, "#C3");
		Assert.AreSame (mb1, mb2, "#C4");
	}