Error when building 0.615

For all mod-related questions and custom code.
Post Reply
BobKare
Offline
Posts: 279
Joined: May 26th, 2011, 2:15 pm

Error when building 0.615

Post 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?

User avatar
fragmer
fCraft Developer
Offline
Posts: 1386
Joined: May 21st, 2011, 10:53 pm

Re: Error when building 0.615

Post 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.

Post Reply