所以在 IDE 中我有以下内容:
public static void ConnectToOperaObjects(ref Microsoft.ClearScript.Windows.JScriptEngine jSE)
{
foreach (Tuple<string, object> tso in new List<Tuple<string, object>>() {
(name: "CSOperaDriver", type: typeof(OpenQA.Selenium.Opera.OperaDriver)),
(name: "CSOperaDriverService", type: typeof(OpenQA.Selenium.Opera.OperaDriverService)),
(name: "CSOperaOptions", type: typeof(OpenQA.Selenium.Opera.OperaOptions)) })
{
jSE.AddHostType(tso.name, tso.type);
}
}
IDE 毫无疑问地编译它。命令行编译器抱怨
Objects.cs(161,17): error CS1950: The best overloaded Add method 'List<Tuple<string, object>>.Add(Tuple<string, object>)' for the collection initializer has some invalid arguments [C:\Users\bugma\Source\Repos\RR\RR\RR.csproj]
Objects.cs(161,17): error CS1503: Argument 1: cannot convert from '(string, System.Type)' to 'Tuple<string, object>' [C:\Users\bugma\Source\Repos\RR\RR\RR.csproj]
Objects.cs(162,17): error CS1950: The best overloaded Add method 'List<Tuple<string, object>>.Add(Tuple<string, object>)' for the collection initializer has some invalid arguments [C:\Users\bugma\Source\Repos\RR\RR\RR.csproj]
Objects.cs(162,17): error CS1503: Argument 1: cannot convert from '(string, System.Type)' to 'Tuple<string, object>' [C:\Users\bugma\Source\Repos\RR\RR\RR.csproj]
Objects.cs(163,17): error CS1950: The best overloaded Add method 'List<Tuple<string, object>>.Add(Tuple<string, object>)' for the collection initializer has some invalid arguments [C:\Users\bugma\Source\Repos\RR\RR\RR.csproj]
Objects.cs(163,17): error CS1503: Argument 1: cannot convert from '(string, System.Type)' to 'Tuple<string, object>' [C:\Users\bugma\Source\Repos\RR\RR\RR.csproj]
命令行工具被调用为
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\amd64\MSBuild.exe" %* /t:Build
以 RR 的csproj文件作为参数。我尝试向其提供文件sln,但没有效果。
解决办法是什么?
慕勒3428872
FFIVE
相关分类