fbpx
Tag

dotnet

Browsing

For a recent project, I had to use Chromedriver.exe to perform some scraping-tasks with Selenium.

The project runs on an IIS on a hosted server, which means I can use Chromedriver.exe at all – something that is not possible on Azure WebApp.

Including Chromedriver.exe in your project

Install the NuGet package Selenium.WebDriver.ChromeDriver

When you now build the project, Chromedriver.exe will be copied to the output directory. Great!

Including it in dotnet publish – for CI/CD pipeline

However, to make it work in a CI/CD pipeline on Azure Devops, we need Chromedriver.exe to be copied during dotnet publish as well.

  1. Open the .csproj file of the ASP.Net web project, you want to use Chromedriver.exe from
  2. Find PropertyGroup
  3. Add a line: <PublishChromeDriver>true</PublishChromeDriver>

That’s it! It will now be including when publishing, which means Azure Devops will include it in the drop – and the Release pipeline will copy it to your destination with the rest of the website!