Programmers learn & share
0 votes
92 views

Problem :

Facing following C# selenium webdriver error while reading Excel Sheet.

missing compiler required member 'microsoft.csharp.runtimebinder.csharpargumentinfo.create'

And the code for reading excel is as below: 

excel.Application x1Appl = new excel.Application(); excel.Workbook x1WorkBook = x1Appl.Workbooks.Open(@"C:\app\o\SearchBy.xlsx"); excel._Worksheet x1WorkSheet = x1WorkBook.Sheets[1];

Kindly let me know is there anything missing?

by (6.9k points)  
edited by | 92 views

2 Answers

0 votes

Solution :

Reference assemblies for Office are exposed via the dynamic return type.To compile you need to add a reference to Microsoft.CSharp.dll.

Also please do the right click on references and check the prompted options.

  1. Click on the add reference and a modal with the left menu assemblies, projects, COM and browse will appear.
  2. now click Assemblies
  3. After that please check Microsoft.CSharp and click Ok.
  4. Finally clean and build your project and the error should disappear.

enter image description here

by (36.1k points)  
0 votes

Solution:

After upgrading to XF 3.x, any and all uses of dynamic variables results in a build error of 

CS0656: Missing compiler required member 
'Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create'

The cause of the problem:

The reference assemblies for Office are exposed via the dynamic return type. To be able to compile you need to add a reference to Microsoft.CSharp.dll.

To solve this

1. No dynamic type

2. Add a dll, Microsoft.CSharp, or add Microsoft.CSharp with nuget.

Use the dotnet command as follows´╝Ü

dotnet add package Microsoft.CSharp --version 4.5.0

 

 
by (10k points)  
2,221 questions
2,694 answers
59 comments
241 users