Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create' - by DebugErr

Status : 

 


7
0
Sign in
to vote
ID 1630573 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 8/5/2015 8:11:43 AM
Access Restriction Public

Description

We tried to compile the following test program, but it fails with an unhandled compiler exception as it seems:

    class Program {
        static void Main(string[] args) {
            dynamic a = new object();
            Bla(a);
        }

        private static void Bla(int a = 3) {
            Debug.WriteLine("Bla int a");
        }

        private static void Bla(string a = "3") {
            Debug.WriteLine("Bla int a b");
        }
    }

The error is given in the title, and no further information has been specified. There are no warnings or underlined error stripes in the editor.
Sign in to post a comment.
Posted by Michael Herman - Toronto on 11/26/2016 at 6:02 PM
I was wrong about NUnit. I had to remove and re-add Microsoft.CSharp to fix the problem (same as what others below have been saying).
Posted by Michael Herman - Toronto on 11/26/2016 at 5:26 PM
Someone (http://stackoverflow.com/questions/31969637/vs2015-build-fails-with-no-error-message-with-dynamic) suggested upgrading to the latest version of NUnit. That worked for me.
Posted by DebugErr on 8/17/2016 at 10:23 AM
I added it as a workaround. It can be closed then. Though an intelligent IntelliSense error could suggest the reference automatically when using the dynamic keyword.
Posted by deeshubby on 8/17/2016 at 10:19 AM
I misspoke. Fat fingered something while I was adding references... indeed you are right.. I double-checked and re-added the Microsoft.CSharp reference and now I'm all good
Posted by DebugErr on 8/17/2016 at 10:00 AM
I'm afraid I never replied back to this.
Adding Microsoft.CSharp.dll as a reference fixes the issue, as described by Jared.

I'm not sure why it doesn't help deeshubby though.
Posted by deeshubby on 8/17/2016 at 9:54 AM
I'm getting this on my on all the MVC controller's ViewBag assignments. Now, my web .csproj was "converted" from VB.NET using a 3rd party utility. However, dropping old references to "Microsoft.VisualBasic" and adding in references to "Microsot.CSharp" has not seemed to remedy the issue.
Posted by Microsoft on 3/9/2016 at 2:37 PM
Thanks for taking the time to file this issue. Based on the error message and usage of dynamic it looks like the project is missing a reference to Microsoft.CSharp.dll. This DLL is necessary for using dynamic in C# projects. If you add that it should unblock the work here.
Posted by JamesQMurphy on 1/2/2016 at 8:40 AM
I saw the same behavior as Brad Wood -- a test project in VS 2015. However, double-clicking the error takes me to a specific line.

Assembly 1 (a class library) contains a method that returns an ExpandoObject:

public class A {
public ExpandoObject Foo() {
     dynamic o = new ExpandoObject();
     o.Bar = "hello";
     return o;
}
}

The test project contains this test:

[TestMethod]
public void Test()
{
var a = new A();
dynamic obj = a.Foo();

//compiler error CS0656 here:
object obj2 = obj;

...
}


Posted by Brad Wood on 11/23/2015 at 7:27 AM
Happened on an MS Test unit test project using VS 2015 for me. If I double click the error, it takes me to a seemingly random line in a unit test.