3

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?

11
  • Do you have Mono's System.Core.dll referenced? Commented Sep 22, 2013 at 13:26
  • Did you add references to System.Core.dll, Microsoft.Dynamic.dll and Microsoft.CSharp.dll? Commented Sep 22, 2013 at 13:26
  • @TimothyP don't have either of them in my list. Commented Sep 22, 2013 at 13:36
  • 4
    You need to enable the C# 4 profile, sounds like you didn't. Google "__enable_profile4=yes" Commented Sep 22, 2013 at 14:13
  • Thanks, I started working on an existing project that appeared configured to work with C# 2.0. -_- Commented Sep 22, 2013 at 14:17

1 Answer 1

3

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"

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.