Почему строка кода подчёркнута красной линией? - C#
Формулировка задачи:
Почему строка кода подчёркнута красной линией?
Подчёркнута нижеприведённая строка:
co.AddExtensions(new File(@"c:\soft\UD\GoogleChromePortable\1_1\Data\profile\SiteGeoIPLocator.crx"));
Привожу код целиком
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using OpenQA.Selenium;
//****//
using System.Diagnostics;
using OpenQA.Selenium.Chrome;
using System.IO;
//****//
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
IWebDriver Browser;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
OpenQA.Selenium.Chrome.ChromeOptions co = new OpenQA.Selenium.Chrome.ChromeOptions();
co.BinaryLocation = @"c:\soft\UD\GoogleChromePortable\1_1\GoogleChromePortable_1.exe";
co.AddExtensions(new File(@"c:\soft\UD\GoogleChromePortable\1_1\Data\profile\SiteGeoIPLocator.crx"));
co.AddArguments(@"c:\soft\UD\GoogleChromePortable\1_1\Data\profile\SiteGeoIPLocator.crx");
// co.AddExtension(Path.GetFullPath("c:\soft\UD\GoogleChromePortable\1_1\profil\SiteGeoIPLocator\SiteGeoIPLocator.crx"));
// chrome://extensions/
//****//
Browser = new OpenQA.Selenium.Chrome.ChromeDriver(co);
Browser.Manage().Window.Maximize();
Browser.Navigate().GoToUrl("http://google.com");
IWebElement SearchInput = Browser.FindElement(By.Id("lst-ib"));
SearchInput.SendKeys("проект домов" + OpenQA.Selenium.Keys.Enter);
}
private void button2_Click(object sender, EventArgs e)
{
}
}
}Решение задачи: «Почему строка кода подчёркнута красной линией?»
textual
Листинг программы
co.AddExtension(@"c:\soft\UD\GoogleChromePortable\1_1\Data\profile\SiteGeoIPLocator.crx");