locked
Issue with 'dynamic' related to System.Runtime RRS feed

  • Question

  • User53707 posted

    My OS: macOS Sierra 10.12.5

    Identical issue in both Visual Studio Community 2017 for Mac, 7.0.1 (build 24) and Xamarin Studio: 6.3 (build 864)

    How to reproduce:

    • New Project -> Mac -> App -> Cocoa App
    • Edit "ViewController.cs", under "// Do any additional setup after loading the view" dynamic w = this; string x1 = this.Description; string x2 = w.Description;

    It throw

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

    • Adding a reference to Microsoft.CSharp

    Now in debug over 'string x2 = w.Description' throw

    System.IO.FileNotFoundException Could not load file or assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.

    I pick from a Windows machine the file c:\WINDOWS\Microsoft.Net\assembly\GACMSIL\System.Runtime\v4.04.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll (37kb) and References -> Edit reference -> .Net Assembly -> Browse ... -> pick the Windows file. adding reference in my Xamarin.Mac project

    And WORKS.

    So, the questions: - Is an expected behiavour or a bug? - I can redistribute Microsoft System.Runtime.dll file within a macOS app bundle?

    p.s. if i remove the System.Runtime reference, and do a "Build -> Build All", still works. Because VS-Mac don't remove the file "x.app/Contents/MonoBundle/System.Runtime.dll" when i removed the reference and do a normal build. If i do a "Build -> Rebuild All" the issue correctly return because the file are removed during a rebuild. This is another problem, of course.

    Wednesday, July 19, 2017 4:16 PM

All replies

  • User35201 posted

    This is absolutely a bug. I've filed in here:

    https://bugzilla.xamarin.com/show_bug.cgi?id=58296

    I've been able to work around it locally by adding (via a text editor) this line in the appropriate location in your csproj:

    <Reference Include="System.Runtime" />
    

    Thanks for the well written report.

    Friday, July 21, 2017 2:55 PM
  • User35201 posted

    Just to follow up, this will be fixed in the next major release d15-4.

    Friday, August 4, 2017 7:45 PM
  • User31568 posted

    any expected release date?

    Saturday, October 28, 2017 10:03 PM
  • User35201 posted

    15.4 is already in stable.

    https://developer.xamarin.com/releases/current/

    Monday, October 30, 2017 3:37 PM