[Mono-list] Compiling ASP.NET MVC 1.0 on Mono.

Marek Habersack grendel at twistedcode.net
Sat Oct 31 17:40:13 EDT 2009


Tom Opgenorth wrote:
> Hello all,
Hello,

> 
> For my own curiousity, I tried to compile the ASP.NET MVC 1.0 source
> code on Mono 2.4.3 (Ubuntu 9.10 x64).  When I do so under either
> MonoDevelop or xbuild, I get this error message:
> 
> Mvc/FormCollection.cs(24,6):   error CS0246:  The type or namespace
> name `FormCollectionBinder' could not be found. Are you missing a
> using directive or an assembly reference?
> 
> Now, FormCollectionBinder is an attribute that adorns the class
> System.Web.MVC.FormCollection.  The declaration of
> FormCollectionBinderAttribute is a private sealed class inside of
> FormCollection.  If I move the code for this attribute outside of the
> class declaration for FormCollection and then try to compile, there
> seems to be no problems.
> 
> Could this be a bug with the compiler?  A simpler case is this:
Yes, and the bug was fixed after 2.4.3 was released.

> 
> using System;
> 
> namespace Test
> {
> 	[MyAttribute]
> 	public class MyClass
> 	{	
> 		private sealed class MyAttribute: Attribute
> 		{
> 			
> 		}
> 		public void MyMethod()
> 		{
> 		 	Console.WriteLine("Hello World!");
> 		}
> 	}
> }
> 
> I could not get this to compile on Mono 2.4.3.  Or, is there something
> special one must do to get this to compile?
A workaround is to move the attribute class outside its containing type.

marek




More information about the Mono-list mailing list