• Register
0 votes

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?

6.9k points
edited by

Please log in or register to answer this question.

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

38.6k points
0 votes


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

CS0656: Missing compiler required member 

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


31.7k points