Suddenly AppDomain unloaded while playmode

I had a problem which is suddenly static variables are set to default or null value.

And which was weird because I just assign the static variable, not nulling them.

Thought it was the garbage collector that was nulling the static variable, but when I saw ‘int’ static variable also set to default value ‘0’, I felt it’s wasn’t the GC, it’s like application problem.

So I attached AppDomain.CurrentDomain.DomainUnload eventlistener, and this event was called while in editor play mode.

My situation was this.
1.Download the assetbundles from server.(I have like 3000 of them)
2.In Scene1, Prior to load some assets, load assetbundle and also the dependent assetbundles. (64 of them)
3.Load Scene2(this also is the assetbundle scene) and this loads dependent assetbundles like 400 of them.(And it tooks like 100seconds)
4.Suddenly AppDomain gets unloaded, my AssetManager class is singleton, but every inside static variables turns to null or default variable.

3119347--235996--2.PNG
This is the singleton, that handles Loading Assets. That singleton never get assigned except in creation.
When it created, It shows Debug.LogError(“ContentsProvider”)


This functions is used to show logs.


This is the log that shows problem. It suddenly appDomain unloads. And other calls ContentsProvider’s singleton, and creates ContentsProvider again, because domain is unloaded, so does singleton is null, so it’s created again.

I tried to find other code that makes AppDomain to unload, Like AppDomain.Unload(CurrentDomain) thingy but there was none of them.
I thought it might be hidden in some 3rdParty dll, so I tried testing AppDomain.Unload(CurrentDomain) myself.
But after that code, it shows thread stopped, and I had to restart the whole editor to get normal.
My problem was AppDomain is some kinda reloaded and working back. It just sets every static variable to null or default value.
So it’s clearly the other code isn’t making this situation.

So my question is this.

-Can loading too much assetbundle cause UnityEngine to reload appDomain?
-Is there anything that cause appDomain to reload or somehow? and is it possible?
-is there any possibility that a user code can make this happen?

Same problem here.
Unsolved in latest Unity build.