Page 1 of 2

unity 2019.1 no types reflection error

Posted: Tue Apr 23, 2019 9:48 pm
by friken
no types are listed in the easysave 3 editor ui and strying to use save in script throws the following:

ReflectionTypeLoadException: Exception of type 'System.Reflection.ReflectionTypeLoadException' was thrown.
System.Reflection.Assembly.GetTypes () (at <23c160f925be47d7a4fd083a3a62c920>:0)
ES3Internal.ES3Reflection.GetInstances[T] () (at Assets/Plugins/Easy Save 3/Scripts/ES3Reflection.cs:276)
ES3Internal.ES3TypeMgr.Init () (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3TypeMgr.cs:122)
ES3Internal.ES3TypeMgr.GetOrCreateES3Type (System.Type type, System.Boolean throwException) (at Assets/Plugins/Easy Save 3/Scripts/Types/ES3TypeMgr.cs:17)
ES3Writer.Write (System.Object value, ES3+ReferenceMode memberReferenceMode) (at Assets/Plugins/Easy Save 3/Scripts/Writers/ES3Writer.cs:127)
ES3Internal.ES3JSONWriter.StartWriteProperty (System.String name) (at Assets/Plugins/Easy Save 3/Scripts/Writers/ES3JSONWriter.cs:126)
ES3Writer.Write[T] (System.String key, System.Object value) (at Assets/Plugins/Easy Save 3/Scripts/Writers/ES3Writer.cs:83)
ES3.Save[T] (System.String key, System.Object value) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:27)
AudioSpectrumData.SaveState (System.Int32 slot) (at Assets/scripts/AudioSpectrumData.cs:564)
AudioSpectrumData.Update () (at Assets/scripts/AudioSpectrumData.cs:851)

Re: unity 2019.1 no types reflection error

Posted: Tue Apr 23, 2019 9:48 pm
by friken
I've tried reimporting easysave newest version from asset store. no luck getting any types... and no ui for adding custom types either.

Re: unity 2019.1 no types reflection error

Posted: Wed Apr 24, 2019 4:53 pm
by Joel
Hi there,

I've had no reports of this, and I don't seem to be able to replicate this at my end.

It sounds like Unity might have cleared the assemblies array when you updated. Please could you go to Assets/Plugins/Easy Save 3/Resources/ES3, open the ES3DefaultSettings prefab and check that the Assembly names array in the ES3DefaultSettings Component contains Assembly-CSharp and Assembly-CSharp-firstpass (as in the screenshot below).

All the best,
Joel

Re: unity 2019.1 no types reflection error

Posted: Thu Apr 25, 2019 5:34 am
by friken
atteched screenshots of settings and types tab

Re: unity 2019.1 no types reflection error

Posted: Thu Apr 25, 2019 8:25 am
by Joel
Please could you create a new project with the minimum amount of code to replicate the issue and PM it over to me?

All the best,
Joel

Re: unity 2019.1 no types reflection error

Posted: Mon Apr 29, 2019 9:44 pm
by friken
it works fine in a new project. Not so much in the project I need it to work in though. No idea why. Any ideas would be great. The project I'm on is 2 years into the project, nothing about it that I see that could break this and it used to work great before upgrade to 2019.

Re: unity 2019.1 no types reflection error

Posted: Tue Apr 30, 2019 12:24 am
by friken
Ok... after many more hours of troubleshooting I have narrowed down the problem but not sure yet how to fix.

It is related to this also being in the project (a vital component that was working fine with easy save before 2019: https://github.com/i-saint/Unity5Effects

Also related is project settings / player / scripting runtime version. It does not work with .net 4.0. But it does work with 3.5 (depreicated and I need 4.0 for my project)

Re: unity 2019.1 no types reflection error

Posted: Tue Apr 30, 2019 12:31 am
by friken
to recreate,

1. new project import easy save
2. copy the "1st" directory from here into the project: https://github.com/i-saint/Unity5Effects
3. copy the Standard Assets folder from the above git project into the new project.

Re: unity 2019.1 no types reflection error

Posted: Tue Apr 30, 2019 10:35 pm
by friken
Any ideas on this? I'm stumped on it and already deeply integrated easy save into our project. We could replace it but not without a lot of work.

Re: unity 2019.1 no types reflection error

Posted: Wed May 01, 2019 4:29 pm
by Joel
Hi there,

I've tried with the instructions you gave but it appears to work fine for me. Please could you PM me a project?

It sounds very likely that the Unity 5 Effects asset you're using is triggering a bug which prevents reflection from working. I noticed when importing it that it uses unsafe code (which only works when enabling the option in Unity), and a lot of deprecated code which has to be automatically updated. If you PM me the basic project you created which replicated it, I'll have a go at seeing exactly what is being prevented.

The case may be that you need to send a bug report to Unity, but I'll hopefully be able to create a script which replicates the issue with the minimum amount of code which you can send them.

All the best,
Joel