Jump to content

CivilianPopulationUI:System.TypeLoadException: Could not load type 'ApplicationLauncher' from assembly


Recommended Posts

I can't figure out I have this problem when my mod is starting :

[ERR 01:39:52.394] Exception handling event onGUIApplicationLauncherReady in class CivilianPopulationUI:System.TypeLoadException: Could not load type 'ApplicationLauncher' from assembly 'CivilianPopulation'.
  at EventVoid.Fire () [0x00000] in <filename unknown>:0 

[EXC 01:39:52.396] TypeLoadException: Could not load type 'ApplicationLauncher' from assembly 'CivilianPopulation'.
	EventVoid.Fire ()
	UnityEngine.Debug:LogException(Exception)
	EventVoid:Fire()
	KSP.UI.Screens.ApplicationLauncher:StartupSequence()
	KSP.UI.Screens.ApplicationLauncher:OnSceneLoadedGUIReady(GameScenes)
	EventData`1:Fire(GameScenes)
	<FireLoadedEventGUIReady>c__Iterator6D:MoveNext()
	UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

The code is quite simple :

using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;

namespace CivilianPopulation
{
    [KSPScenario(ScenarioCreationOptions.AddToNewCareerGames | ScenarioCreationOptions.AddToExistingCareerGames, GameScenes.SPACECENTER)]
    public class CivilianPopulationUI : ScenarioModule
    {
        public void Start()
        {
            log(".Start!"); 
            GameEvents.onGUIApplicationLauncherReady.Add(onAppLauncherReady);//when AppLauncher can take apps, give it OnAppLauncherReady (mine)
            GameEvents.onGUIApplicationLauncherDestroyed.Add(onAppLauncherDestroyed);//Not sure what this does
        }

        private void onAppLauncherReady()
        {
            log(".onAppLauncherReady!");
            if (ApplicationLauncher.Instance == null)
            {
                log(" - ApplicationLauncher.Instance is null!");
            }
            else
            {
                log(" - ApplicationLauncher.Instance is not null!");
            }
        }
    }
}

And the error is fired when I load the KSP.

Anyone have an idea what I am doing wrong ?

 

Thanks !

Link to comment
Share on other sites

Thanks for your help ! I added a reference to all the dll I found in the KSP directory and it works now :)

@sarbian : Sorry I tried to clean up the code before posting it and cleaned too much.

 

 

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...