public void TestFixtureSetUp() { string[] asms = { asmFilename }, mappings = { Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"TestProject\Ayende.NHibernateQueryAnalyzer.TestProject.hbm.xml") }; current = new RemoteProject(); current.Cfg.SetProperty("connection.provider", "NHibernate.Connection.DriverConnectionProvider"); current.Cfg.SetProperty("dialect", "NHibernate.Dialect.SQLiteDialect"); current.Cfg.SetProperty("connection.driver_class", typeof(SQLite20Driver).AssemblyQualifiedName); current.Cfg.SetProperty("connection.connection_string", conStr); current.BuildInternalProject(asms, mappings, new string[0], new ArrayList()); }
/// <summary> /// Prepare the project for work. /// It will create an AppDomain, load the required files and prepare the /// project for real work. /// </summary> public virtual void BuildProject() { try { InitializeProject(); HandleFiles(); AppDomainSetup.ShadowCopyFiles = "true"; AppDomainSetup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory; AppDomainSetup.PrivateBinPath = CreatePrivateBinPath(); appDomain = AppDomain.CreateDomain(Name, null, AppDomainSetup); //This is so the domain can pick up the stuff that it needs like the project loaders //and nhibernate. remoteProject = (RemoteProject)appDomain.CreateInstanceFromAndUnwrap( Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Ayende.NHibernateQueryAnalyzer.ProjectLoader.dll"), "Ayende.NHibernateQueryAnalyzer.ProjectLoader.RemoteProject"); remoteProject.BuildInternalProject(assemblies, mappings, configurations, basePaths); isProjectBuilt = true; } catch (Exception) { isProjectBuilt = false; throw; } }