Alphablackwolf / SkillPrestige

7 stars 17 forks source link

Crash on game exit. #2

Closed Iomega0318 closed 7 years ago

Iomega0318 commented 7 years ago

The game saves fine and will exit, however the SMAPI console doesn't close and when I then went to the console to close it I recieved the following:

[01:45:13.962 PM] Critical error: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
   at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   at System.Reflection.RuntimeModule.GetTypes()
   at System.Reflection.Assembly.GetTypes()
   at SkillPrestige.Mods.ModHandler.<>c.<RegisterLoadedMods>b__1_0(Assembly x)
   at System.Linq.Enumerable.<SelectManyIterator>d__16`2.MoveNext()
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at SkillPrestige.Mods.ModHandler.RegisterLoadedMods()
   at SkillPrestige.SkillPrestigeMod.GameLoaded(Object sender, EventArgs args)
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at StardewModdingAPI.Events.GameEvents.InvokeGameLoaded() in Z:\Projects\SMAPI\src\StardewModdingAPI\Events\Game.cs:line 49
   at StardewModdingAPI.Program.GameRunInvoker() in Z:\Projects\SMAPI\src\StardewModdingAPI\Program.cs:line 170
   at StardewModdingAPI.Program.Main(String[] args) in Z:\Projects\SMAPI\src\StardewModdingAPI\Program.cs:line 59
[01:45:13.963 PM] The API will now terminate. Press any key to continue...

As it stated your mod was the one that had an error I thought I would post it here, let me know if I need to post it over on the SMAPI git. Error log attached. MODDED_ProgramLog.Log_LATEST.txt

Thank you.

Alphablackwolf commented 7 years ago

Sorry it took me so long to respond to this, I thought I had a fix in my latest version, but it seems it's not the same issue. Could you go to the skill prestige mod config.json file and change the "LogLevel" from 3 to 5, then run the game again, and when you run into the error re-post the error log? That would help me look into this further.

Edit: Tech note: I believe this has something to do with one of your other loaded mods that doesn't play nice with the reflection I'm using. Essentially what is happening is that my mod looks through all of the loaded assemblies (read: every mod's code including SMAPI) and creates a list of each type (class, enumeration, interface, etc), then goes through each of them to find ones that might implement my declaration of a skill mod so it can be compatible with that new skill. What is going wrong here is the code is encountering an error in pulling up that list of types, although as of yet I cannot say why.

Alphablackwolf commented 7 years ago

this should now be fixed.

Iomega0318 commented 7 years ago

Sorry for some reason I wasn't getting email updates for this, also I would have to backtrack to find out which mod may have caused it but I'm glad to hear it should be fixed now, I'll test it out the next time I get on and update my mods.