[Mono-devel-list] Question: Adding Class to corlib

Christoph Stiedl Shorty.10 at gmx.at
Mon Jan 24 09:30:58 EST 2005


Hi, 
 
I'd like to add the following class to the corlib: 
 
-------------------------------------------------- 
using System; 
 
namespace System.AOP { 
        [Serializable]    // check if serializable is necessary 
	public class AOPEnvironment { 
                 
                public AOPEnvironment() { 
			 
		}                 
               
		[MethodImplAttribute(MethodImplOptions.InternalCall)] 
		extern static void add_aspect (); 
 
                public static void AddAspect() { 
			// add_aspect(); 
		} 
		                               
                public override string ToString() { 
                        string result = "AOPEnvironment"; 
                        return result; 
                } 
 
		// no idea what that is (#if false) 
		 
		// 
		// These are not on the Framework 
		// 
#if false 
		 
                public override bool Equals(Object obj) { 
                        if ((obj == null) || (!(obj is AOPEnvironment))) { 
                                return false; 
                        } 
                         
			 
			// check that 
			 
                        //AOPEnvironment rhs = (AOPEnvironment) obj; 
                         
                        //if (FrameCount != rhs.FrameCount) { 
                        //        return false; 
                        //} 
                         
                        //for (int i = 0; i < FrameCount; i++) { 
                        //        if 
(!GetFrame(i).Equals(rhs.GetFrame(i))) { 
                        //                return false; 
                        //        } 
                        //} 
                         
                        return true; 
                } 
                 
                public override int GetHashCode() { 
                        // check that 
			 
			//return FrameCount; 
			return 5; 
                } 
#endif 
                 
        } 
} 
 
 
------------------------------------------------- 
 
and use it like this: 
 
------------------------------------------------ 
 
	using System; 
	using System.AOP; 
 
	public class Simple { 
 
		public static void Main(string[] args) { 
			AOPEnvironment.AddAspect(); 
		} 
		 
	} 
------------------------------------------------ 
 
What is necessary for that? I created the folder System.AOP in 
corlib and added the line 
 
System.AOP/AOPEnvironment.cs 
 
in the File colib.dll.sources. 
 
After compiling and installing the Compiler = 
make and make install in the directory mcs-1.0.2 
i compile my file: 
 
mcs Simple.cs and get the following error: 
 
error CS0246: The namespace `System.AOP' can not be found (missing 
assembly reference?) 
 
What is wrong? Are there more places I have to make changes? 
 
Thanks for your help 
 
Christoph 
 

-- 
10 GB Mailbox, 100 FreeSMS http://www.gmx.net/de/go/topmail
+++ GMX - die erste Adresse für Mail, Message, More +++



More information about the Mono-devel-list mailing list