简体   繁体   中英

Where to put chromedriver.exe for release of Selenium WebDriver C#

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?

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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM