[Mono-list] dmcs doesn't seem to be compiling for 3.5?

Alix awolf.business at gmail.com
Tue Mar 9 09:13:08 EST 2010


Hi everyone. I'm having trouble getting a very simple piece of code to work.
The problem is quite simply that it's .NET 3.5, and somehow dmcs doesn't
seem to be compiling it to the appropriate build, or maybe it's mono that
doesn't run it as it should. Here it goes, step by step:

* I've created a very simple program that calls the constructor of
ReaderWriterLockSlim with LockRecursionPolicy.SupportsRecursion, which
requires 3.5. Here's the code, which is in a file called TestSlim.cs:

using System.Threading;
namespace Test.Slim {
    public class TestSlim {
		public static void Main(string[] args) {
			new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
		}
	}
}

* I run:
       dmcs TestSlim.cs
  which generates TestSlim.exe..

* I run:
       mono TestSlim.exe
  which produces the following exception:

Unhandled Exception: System.NotImplementedException: recursionPolicy !=
NoRecursion not currently implemented
  at System.Threading.ReaderWriterLockSlim..ctor (LockRecursionPolicy
recursionPolicy) [0x00000] in <filename unknown>:0
  at Test.Slim.ReentrantReaderWriterLock..ctor () [0x00000] in <filename
unknown>:0
  at Test.Slim.ReentrantReaderWriterLock.Main (System.String[] args)
[0x00000] in <filename unknown>:0

Even though recursion is supported since .NET 3.5, as stated 
http://msdn.microsoft.com/en-us/library/system.threading.readerwriterlockslim.aspx
here .

Here's my dmcs version:
 %> dmcs --version
      Mono C# compiler version 2.6.1.0

And my mono version:
 %> mono --version
      Mono JIT compiler version 2.6.1 (tarball Tue Mar  9 12:33:42 CET 2010)

According to  http://www.mono-project.com/CSharp_Compiler this  dmcs is the
appropriate command to use to compile starting with mono 2.6, and it will
default to .NET 3.x. Is there anything I should do to make sure it's 3.5 or
higher?

Thanks a lot.
-- 
View this message in context: http://n4.nabble.com/dmcs-doesn-t-seem-to-be-compiling-for-3-5-tp1586012p1586012.html
Sent from the Mono - General mailing list archive at Nabble.com.


More information about the Mono-list mailing list