6

I have my chromedriver.exe in my local documents, working fine. But it's time to deploy to production. Somehow I need to bundle it with my software, and reference it locally.

How do I go about locally referencing my driver, and where should I put it?

Ripon Al Wasim
  • 36,924
  • 42
  • 155
  • 176
User
  • 23,729
  • 38
  • 124
  • 207

1 Answers1

6

Copy Chromedriver.exe into your project's solution / project folder. Add it to the project in visual studio. Right click the file and choose properties. Build Action should be set to 'Content'. That will mean when you build/deploy the bin folder will contain a copy of the chromedriver. When you reference the chromedriver.exe directly, you should look for it adjacent to the executable path of your program.

Good source on detecting location of current assembly/executable: How do I get the path of the assembly the code is in?

Community
  • 1
  • 1
Richthofen
  • 2,076
  • 19
  • 39