unity 2019.1 no types reflection error

Discussion and help for Easy Save 3
friken
Posts: 12
Joined: Tue Apr 23, 2019 9:46 pm

unity 2019.1 no types reflection error

Post 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)
friken
Posts: 12
Joined: Tue Apr 23, 2019 9:46 pm

Re: unity 2019.1 no types reflection error

Post 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.
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: unity 2019.1 no types reflection error

Post 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
Attachments
Screenshot 2019-04-24 at 17.50.58.png
Screenshot 2019-04-24 at 17.50.58.png (131.1 KiB) Viewed 4077 times
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
friken
Posts: 12
Joined: Tue Apr 23, 2019 9:46 pm

Re: unity 2019.1 no types reflection error

Post by friken »

atteched screenshots of settings and types tab
Attachments
settings
settings
ss2.JPG (17.63 KiB) Viewed 4076 times
types tab
types tab
ss1.JPG (27.7 KiB) Viewed 4076 times
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: unity 2019.1 no types reflection error

Post 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
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
friken
Posts: 12
Joined: Tue Apr 23, 2019 9:46 pm

Re: unity 2019.1 no types reflection error

Post 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.
friken
Posts: 12
Joined: Tue Apr 23, 2019 9:46 pm

Re: unity 2019.1 no types reflection error

Post 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)
friken
Posts: 12
Joined: Tue Apr 23, 2019 9:46 pm

Re: unity 2019.1 no types reflection error

Post 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.
friken
Posts: 12
Joined: Tue Apr 23, 2019 9:46 pm

Re: unity 2019.1 no types reflection error

Post 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.
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: unity 2019.1 no types reflection error

Post 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
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply