errors on adding gizmo..

Started by ricemaster, April 15, 2016, 07:20:06 AM

Previous topic - Next topic

ricemaster

hello.

I'm trying to add gizmo on my mod but...

System.TypeLoadException: Could not load type 'System.Action' from assembly 'Landmines'.

  at RimWorld.InspectGizmoGrid.DrawInspectGizmoGridFor (IEnumerable`1 selectedObjects) [0x00000] in <filename unknown>:0


this exception keep happens.

        public override IEnumerable<Gizmo> GetGizmos()
        {
            IList<Gizmo> clist = new List<Gizmo>();
            Command_Action Cact;
            Cact = new Command_Action();
            Cact.icon = toggletrap;
            Cact.defaultDesc = "Toggle arm state";
            Cact.activateSound = SoundDef.Named("Click");
            Cact.action = new Action(this.ToggleArm);
            Cact.groupKey = 13379998;
            Cact.hotKey = KeyBindingDefOf.Misc1;
            clist.Add(Cact);
            IEnumerable<Gizmo> gizmos = base.GetGizmos();
            if (gizmos != null)
                return clist.AsEnumerable<Gizmo>().Concat(gizmos);
            else
                return clist.AsEnumerable<Gizmo>();
        }


this is my code for gizmo. am I missing something? or overrided gizmo in wrong way? the other parts of code work just fine  :(
I checked the forum and found a similar thread(about .NET version) but .NET version of my project is 4.5.

1000101

You will need to change your .Net target to Mono/.Net 3.5 as that is what the game is built against.

Also, make sure you are referencing the correct libraries and are including the correct namespaces.
(2*b)||!(2*b) - That is the question.
There are 10 kinds of people in this world - those that understand binary and those that don't.

Powered By

ricemaster

Quote from: 1000101 on April 15, 2016, 08:56:45 PM
You will need to change your .Net target to Mono/.Net 3.5 as that is what the game is built against.

Also, make sure you are referencing the correct libraries and are including the correct namespaces.

I changed .NET version to 3.5 and it works! Thanks a lot  :)