Inheritance: System.MarshalByRefObject
Ejemplo n.º 1
0
        public virtual void FixtureInitialize()
        {
            String virDir      = GetVirtualDir();
            String physicalDir = GetPhysicalDir();

            if (!Path.IsPathRooted(physicalDir))
            {
                DirectoryInfo dinfo = new DirectoryInfo(Path.Combine(
                                                            AppDomain.CurrentDomain.SetupInformation.ApplicationBase, physicalDir));

                physicalDir = dinfo.FullName;
            }

            if (!Directory.Exists(Path.Combine(physicalDir, "bin")) ||
                !File.Exists(Path.Combine(physicalDir, "web.config")))
            {
                String message = String.Format("The path specified for the " +
                                               "web project doesnt look as a web project dir (bin directory or web.config missing): {0}", physicalDir);
                throw new ConfigurationException(message);
            }

            host = (WebAppHost)ApplicationHost.CreateApplicationHost(
                typeof(WebAppHost), virDir, physicalDir);

            host.Configure(virDir, physicalDir);
        }
Ejemplo n.º 2
0
		public virtual void FixtureInitialize()
		{
			String virDir = GetVirtualDir();
			String physicalDir = GetPhysicalDir();

			if (!Path.IsPathRooted(physicalDir))
			{
				DirectoryInfo dinfo = new DirectoryInfo(
					Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, physicalDir));

				physicalDir = dinfo.FullName;
			}

			if (!Directory.Exists(Path.Combine(physicalDir, "bin")) ||
			    !File.Exists(Path.Combine(physicalDir, "web.config")))
			{
				String message = String.Format("The path specified for the " +
				                               "web project doesnt look as a web project dir (bin directory or web.config missing): {0}",
				                               physicalDir);
				throw new ConfigurationErrorsException(message);
			}

			host = (WebAppHost) ApplicationHost.CreateApplicationHost(
			                    	typeof(WebAppHost), virDir, physicalDir);

			host.Configure(virDir, physicalDir);
		}