Page 1 of 1

Error when building 0.615

Posted: February 3rd, 2012, 5:57 pm
by BobKare
After the 0.615 release, I've moved all my mods and such over to the new files, and when I build it, it gives an error which shouldn't have anything with what I've touched to do!
This is the error:

Cannot take the address of, get the size of, or declare a pointer to a managed type ('System.RuntimeTypeHandle') (...)\fCraft\Utils\ExtensionMethods.cs
Line: 588
Column: 34


I clicked it:

Code: Select all

        public static int SizeOf( Type type ) {
            if( type.IsValueType ) {
                return System.Runtime.InteropServices.Marshal.SizeOf( type );
            } else {
                RuntimeTypeHandle th = type.TypeHandle;
                return *(*(int**)&th + 1);
The blue wiggly line is under "&th" in "return *(*(int**)&th + 1);"

What is this?

Re: Error when building 0.615

Posted: February 3rd, 2012, 6:43 pm
by fragmer
That's a debugging method that works with .NET 3.5 / VisualStudio 2008. You are trying to build for .NET 4.0 / VisualStudio 2010, so you can just comment that part out.