• Register
0 votes
144 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?

6.9k points
edited by

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

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

 

 
15.3k points

Related questions

0 votes
1 answer 13 views
13 views
Problem: I am beginner to C#. Please find below my code for your help: public class MySoundManager : MonoBehaviour { public List<AudioSource> audioSounds = new List<AudioSource>(); public double minTime = 0.5; public static void playSound(AudioClip sourceSound, Vector3 objectPosition, int ... to create the object of a class or create a methods as the static one but I don&rsquo;t know how to do it.
asked Jul 22 Raphael Pacheco 2.3k points
1 vote
2 answers 32 views
32 views
Problem: I am beginner to C# with Unity engine. I have already started learning C# with Unity engine. I have tried to write the very basic script as shown below for your reference: using UnityEngine; using System.Collections; public class scriptMyBall : MonoBehaviour { / ... but unable to fix the Unity Engine related error. I need Unity Engine&rsquo;s expert who can guide me in fixing above error.
asked May 23 Martin K 6.6k points
0 votes
1 answer 107 views
107 views
Problem : I am having the following error whenever I am trying to open Excel Online in Chrome, But Excel Online in Safari is working fine for me. Does anyone know how to fix this issue? Sign in Something went wrong and we can't sign you in ... . Please try again later. The Microsoft account login server has detected too many repeated authentication attempts. Please wait a moment and try again.
asked Nov 26, 2019 alecxe 7.5k points
0 votes
2 answers 134 views
134 views
Problem : I am facing below error while trying to compile my code of C# in visual Studio 2015. &ldquo;There is no argument given that corresponds to the required formal parameter&rdquo;
asked Jan 22 jwilliam 3.9k points