Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Mono Upgrade Dynamic requires Microsoft.Csharp.dll in Visual Studio

Discussion in 'Experimental Scripting Previews' started by makeshiftwings, Nov 2, 2016.

  1. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    The "dynamic" keyword works correctly in the editor from what I've seen, but when editing in Visual Studio with the new custom VSTU plugin, using it marks all dynamic objects as errors and doesn't compile because it is missing a reference to Microsoft.Csharp.dll. Can this be added to the auto-generated projects?

    Example, works fine in editor but shows as error in VS:
    Capture.JPG
     
  2. JDCaptainAmerica

    JDCaptainAmerica

    Joined:
    May 11, 2018
    Posts:
    1
    I'm having the same problem:

    dynamic array = JsonConvert.DeserializeObject(json);

    error CS1969: Dynamic operation cannot be compiled without `Microsoft.CSharp.dll' assembly reference

    help!
     
  3. milkshakeiii

    milkshakeiii

    Joined:
    Feb 16, 2013
    Posts:
    9
    Yes. Same here! "Missing compiler required member Microsoft.Csharp.RuntimeBinder.CSharpArgumentsInfo.Create"

    Why does the editor see this Microsoft.Csharp.dll method but VisualStudio does not... how can I get visual studio to see it...

    Edit: Just noticed the original post is 2 years old, but the reply is not. Has this simply cropped up again? What are we missing?
     
  4. dCalle

    dCalle

    Joined:
    Dec 16, 2013
    Posts:
    55
    having the same issue in Rider 2018.1. Unity keeps on removing the Reference to Microsoft.CSharp.dll. What I've seen so far, that it works with some dynamic types. And the Unity API Updater compiles it to a non dynamic approach. However. I'm having another Issue, where I can't cast dynamic to Delegate, which is a pain in the ass, since Delegate constraints in generics are only going to be introduced in C# 7.3 and Unity probably needs another year to implement those features as well.

    :-(
     
  5. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,920
    How is the reference to Microsoft.Csharp.dll being added? I'm surprised that Unity is removing it - I'd like to know more.
     
  6. joncham

    joncham

    Unity Technologies

    Joined:
    Dec 1, 2011
    Posts:
    276
    We now (2018.3) add Microsoft.Csharp.dll as a reference and support C# 7.3 which means the delegate constraint should work.
     
  7. frederik99

    frederik99

    Joined:
    Jan 17, 2015
    Posts:
    4
    Is this supposed to be included in the latest beta? Because i still get the same error when using dynamics.
     
  8. joncham

    joncham

    Unity Technologies

    Joined:
    Dec 1, 2011
    Posts:
    276
    The changes I expect to fix this are in 2018.3.0b6.
     
  9. frederik99

    frederik99

    Joined:
    Jan 17, 2015
    Posts:
    4
    I use 2018.3.0b7 and get the following error:
    Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.Binder.Convert'
     
  10. slampants

    slampants

    Joined:
    Oct 27, 2013
    Posts:
    7
    Having this issue as well, running Unity 2018.3.6f1
     
  11. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,920
    Can you provide a bug report? This issue should be corrected, but maybe you are experiencing something slightly different.
     
  12. runner78

    runner78

    Joined:
    Mar 14, 2015
    Posts:
    789
    Using "dynamic" is bad practice and very slow. Should be avoided.
     
  13. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,924
    Unity 2019: cannot use dynamic and use Assemblies at the same time.

    dynamic alone works fine.

    Create an assembly, and ... boom.

    Is this by design? Or a known bug?
     
    Nikolass900 likes this.
  14. Nikolass900

    Nikolass900

    Joined:
    Jun 29, 2022
    Posts:
    1
    Hi! Is there any way to solve this issue?