public WebApiTest()
		{
			IOExtensions.DeleteDirectory("Test");
			NonAdminHttp.EnsureCanListenToWhenInNonAdminContext(19079);
			Task.Factory.StartNew(() => // initialize in MTA thread
				                      {
					                      config = new HttpSelfHostConfiguration(Url)
						                               {
							                               MaxReceivedMessageSize = Int64.MaxValue,
							                               TransferMode = TransferMode.Streamed
						                               };
					                      var configuration = new InMemoryConfiguration();
					                      configuration.Initialize();
					                      configuration.DataDirectory = "~/Test";
					                      ravenFileSystem = new RavenFileSystem(configuration);
					                      ravenFileSystem.Start(config);
				                      })
			    .Wait();

			server = new HttpSelfHostServer(config);
			server.OpenAsync().Wait();

			WebClient = new WebClient
				            {
					            BaseAddress = Url
				            };
		}
		protected void StartServerInstance(int port)
		{
			NonAdminHttp.EnsureCanListenToWhenInNonAdminContext(port);
			HttpSelfHostConfiguration config = null;
			Task.Factory.StartNew(() => // initialize in MTA thread
				                      {
					                      config = new HttpSelfHostConfiguration(ServerAddress(port))
						                               {
							                               MaxReceivedMessageSize = Int64.MaxValue,
							                               TransferMode = TransferMode.Streamed
						                               };

					                      var configuration = new InMemoryConfiguration();
					                      configuration.Initialize();
					                      configuration.DataDirectory = "~/" + port;
					                      configuration.Port = port;

					                      IOExtensions.DeleteDirectory(configuration.DataDirectory);

					                      var ravenFileSystem = new RavenFileSystem(configuration);
					                      ravenFileSystem.Start(config);
					                      disposables.Add(ravenFileSystem);
				                      })
			    .Wait();

			var server = new HttpSelfHostServer(config);
			server.OpenAsync().Wait();

			disposables.Add(server);
		}
		protected void Application_Start(object sender, EventArgs e)
		{
			HttpEndpointRegistration.RegisterHttpEndpointTarget();
			ConfigureLogging();

			ravenFileSystem = new RavenFileSystem(new RavenFileSystemConfiguration());

			ravenFileSystem.Start(GlobalConfiguration.Configuration);

            // turn this on so we don't a conflict between the /search endpoint handled by the SearchController
            // and the Search folder.
		    RouteTable.Routes.RouteExistingFiles = true;
		}
		public void Start()
		{
			ravenFileSystem = new RavenFileSystem(Configuration);
			config = new HttpSelfHostConfiguration(Configuration.ServerUrl)
			{
				MaxReceivedMessageSize = Int64.MaxValue,
				TransferMode = TransferMode.Streamed,
				ReceiveTimeout = TimeSpan.MaxValue,
				SendTimeout = TimeSpan.MaxValue,
			};
			ravenFileSystem.Start(config);
			server = new HttpSelfHostServer(config);
			server.OpenAsync().Wait();
		}