There is the same example copy-pasted all over the internet, but firstly, I found examples for Java which I could find a way to make it work for C# so far and I wonder if that code is still working at all or is it something outdated already? I found stuff like this and this
Example of my attempts in the code:
string downloadFilepath = "D:/test";
ChromeOptions options = new ChromeOptions();
Dictionary<string, object> chromePrefs = new Dictionary<string, object>();
chromePrefs.Add("profile.default_content_settings.popups", 0);
chromePrefs.Add("download.default_directory", downloadFilepath);
//options.setExperimentalOption("prefs", chromePrefs); // doesn't work since ChromeOptions doesn't contain method setExperimentalOption or anything similar
options.AddArguments("prefs", chromePrefs.ToString()); // doesn't work neither (just was trying something relatively logical)
IWebDriver webDriver = new ChromeDriver(options);