public static RecyclableAppDomain.Handle GetTemplatingDomain()
 {
     if (domain == null || domain.Used)
     {
         var dir  = Path.GetDirectoryName(typeof(TemplatingEngine).Assembly.Location);
         var info = new AppDomainSetup()
         {
             ApplicationBase = dir,
         };
         domain = new RecyclableAppDomain("T4Domain", info);
     }
     return(domain.GetHandle());
 }
		public static RecyclableAppDomain.Handle GetTemplatingDomain ()
		{
			if (domain == null || domain.Used) {
				var info = new AppDomainSetup () {
					ApplicationBase = System.IO.Path.GetDirectoryName (typeof (RecyclableAppDomain).Assembly.Location),
					DisallowBindingRedirects = false,
					DisallowCodeDownload = true,
					ConfigurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile,
				};
				domain = new RecyclableAppDomain ("T4Domain", info);
				var handle = domain.GetHandle ();
				handle.AddAssembly (typeof (TemplatingEngine).Assembly);
				handle.AddAssembly (typeof (TextTemplatingService).Assembly);
				return handle;
			}
			return domain.GetHandle ();
		}
 public static RecyclableAppDomain.Handle GetTemplatingDomain()
 {
     if (domain == null || domain.Used)
     {
         var info = new AppDomainSetup()
         {
             ApplicationBase          = System.IO.Path.GetDirectoryName(typeof(RecyclableAppDomain).Assembly.Location),
             DisallowBindingRedirects = false,
             DisallowCodeDownload     = true,
             ConfigurationFile        = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile,
         };
         domain = new RecyclableAppDomain("T4Domain", info);
         var handle = domain.GetHandle();
         handle.AddAssembly(typeof(TemplatingEngine).Assembly);
         handle.AddAssembly(typeof(TextTemplatingService).Assembly);
         return(handle);
     }
     return(domain.GetHandle());
 }