Question: I am getting error while using Firefox with WebDriver.

```
org.openqa.selenium.firefox.NotConnectedException: Unable to connect
to host 127.0.0.1 on port 7055 after 45000 ms.

```

* Firefox version:47.0
* Selenium:2.53.0
* Windows 10 64 bit

Is anyone getting a similar issue or any idea what is the solution for this? It's working fine with Chrome but with Firefox none of the URLs are getting loaded.

Answer: 
In case anyone is wondering how to use Marionette in C#.

```
FirefoxProfile profile = new FirefoxProfile(); // Your custom profile
var service = FirefoxDriverService.CreateDefaultService("DirectoryContainingTheDriver", "geckodriver.exe");
// Set the binary path if you want to launch the release version of Firefox.
service.FirefoxBinaryPath = @"C:\Program Files\Mozilla Firefox\firefox.exe";
var option = new FirefoxProfileOptions(profile) { IsMarionette = true };
var driver = new FirefoxDriver(
    service,
    option,
    TimeSpan.FromSeconds(30));

```

Overriding FirefoxOptions to provide the function to add additional capability and set Firefox profile because [selenium v53](https://github.com/SeleniumHQ/selenium/blob/selenium-2.53.0/dotnet/src/webdriver/Firefox/FirefoxOptions.cs) doesn't provide that function yet.

```
public class FirefoxProfileOptions : FirefoxOptions
{
    private DesiredCapabilities _capabilities;

    public FirefoxProfileOptions()
        : base()
    {
        _capabilities = DesiredCapabilities.Firefox();
        _capabilities.SetCapability("marionette", this.IsMarionette);
    }

    public FirefoxProfileOptions(FirefoxProfile profile)
        : this()
    {
        _capabilities.SetCapability(FirefoxDriver.ProfileCapabilityName, profile.ToBase64String());
    }

    public override void AddAdditionalCapability(string capabilityName, object capabilityValue)
    {
        _capabilities.SetCapability(capabilityName, capabilityValue);
    }

    public override ICapabilities ToCapabilities()
    {
        return _capabilities;
    }
}

```

Note: Launching with profile doesn't work with FF 47, it works with FF 50 Nightly.

However, we tried to convert our test to use Marionette, and it's just not viable at the moment because the implementation of the driver is either not completed or buggy. I'd suggest people downgrade their Firefox at this moment.
It seems to me that the best solution is to update to Selenium 3.0.0, download geckodriver.exe and use Firefox 47 or higher.

I changed Firefox initialization to:

```
 string geckoPathTest = Path.Combine(Environment.CurrentDirectory, "TestFiles\\geckodriver.exe");
 string geckoPath = Path.Combine(Environment.CurrentDirectory, "geckodriver.exe");
 File.Copy(geckoPathTest, geckoPath);
 Environment.SetEnvironmentVariable("webdriver.gecko.driver", geckoPath);
 _firefoxDriver = new FirefoxDriver();

```