Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using `dynamic` keyword in C# doesn't compile

I'm trying to compile a piece of C# code that contains the dynamic keyword. (I need this keyword for using ironpython.) However, it doesn't compile, complaining that

error CS1980: Dynamic keyword requires 
`System.Runtime.CompilerServices.DynamicAttribute' to be defined.
Are you missing System.Core.dll assembly reference?

The compiler I'm using is Mono JIT compiler version 2.10.8.1. I don't have System.Runtime.CompilerServices.DynamicAttribute in the list of possible references.

How can I make mono accept the dynamic keyword?

like image 898
chtenb Avatar asked Mar 17 '26 03:03

chtenb


1 Answers

This comment of Hans Passant solved the problem:

You need to enable the C# 4 profile, sounds like you didn't. Google "__enable_profile4=yes"

like image 76
chtenb Avatar answered Mar 19 '26 18:03

chtenb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!