Code: Select all
var queue = new Queue<string>();
queue.Enqueue("Test");
ES3.Save("queue", queue, "queue.es3");
var loaded = ES3.Load<Queue<string>>("queue", "queue.es3");
Debug.Log(loaded.Count);
Code: Select all
var queue = new Queue<string>();
queue.Enqueue("Test");
ES3.Save("queue", queue, "queue.es3");
var loaded = ES3.Load<Queue<string>>("queue", "queue.es3");
Debug.Log(loaded.Count);
Code: Select all
MissingMethodException: Constructor on type 'System.Collections.Generic.Queue`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' not found.
at System.RuntimeType.CreateInstanceImpl (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes, System.Threading.StackCrawlMark& stackMark) [0x00000] in <00000000000000000000000000000000>:0
at System.Activator.CreateInstance (System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) [0x00000] in <00000000000000000000000000000000>:0
at ES3Types.ES3QueueType.Read (ES3Reader reader) [0x00000] in <00000000000000000000000000000000>:0
at ES3Reader.Read[T] (ES3Types.ES3Type type) [0x00000] in <00000000000000000000000000000000>:0
at ES3Reader.Read[T] (System.String key) [0x00000] in <00000000000000000000000000000000>:0
at ES3.Load[T] (System.String key, ES3Settings settings) [0x00000] in <00000000000000000000000000000000>:0
at PreloadMenu.Awake () [0x00000] in <00000000000000000000000000000000>:0
Here would be better just so that if someone else runs into the same issue it'll be easier for them to find the solution as this forum is indexed by Google.Nixtheworld wrote: ↑Fri Feb 17, 2023 9:08 am Hey Joel, I am on your Discord. Would it be easier to post there?
This definitely looks like your stripping settings mean that the constructor is being stripped out. There's a number of ways to prevent this from happening:MissingMethodException: Constructor on type 'System.Collections.Generic.Queue`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' not found.
at System.RuntimeType.CreateInstanceImpl (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes, System.Threading.StackCrawlMark& stackMark) [0x00000] in <00000000000000000000000000000000>:0
at System.Activator.CreateInstance (System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) [0x00000] in <00000000000000000000000000000000>:0
at ES3Types.ES3QueueType.Read (ES3Reader reader) [0x00000] in <00000000000000000000000000000000>:0
at ES3Reader.Read[T] (ES3Types.ES3Type type) [0x00000] in <00000000000000000000000000000000>:0
at ES3Reader.Read[T] (System.String key) [0x00000] in <00000000000000000000000000000000>:0
at ES3.Load[T] (System.String key, ES3Settings settings) [0x00000] in <00000000000000000000000000000000>:0
at PreloadMenu.Awake () [0x00000] in <00000000000000000000000000000000>:0
Code: Select all
var tempQueue = new Queue<string>(new List<string>());
Code: Select all
<linker>
<assembly fullname="mscorlib">
<type fullname="System.Collections.Generic.Queue`1" preserve="all"/>
</assembly>
</linker>
Code: Select all
Queue<string> tempQueue = new Queue<string>(new List<string>());