Notter
November 18, 2015, 1:49pm
1
Hi, for the last 2 days i’m trying to figure what’s wrong with my plugin, but i have no idea.
i’ve got a plugin, that references another library.
I’ve imported everything to unity’s Plugins directory.
I’ve set the platform to “WSA player”.
now, i’ve got 2 problems:
the “fake” editor plugin gives me this error:
Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
at System.Reflection.Assembly.GetTypes () [0x00000] in :0
at Mono.CSharp.RootNamespace.ComputeNamespaces (System.Reflection.Assembly assembly, System.Type extensionType) [0x00000] in :0
at Mono.CSharp.RootNamespace.ComputeNamespace (Mono.CSharp.CompilerContext ctx, System.Type extensionType) [0x00000] in :0
at Mono.CSharp.GlobalRootNamespace.ComputeNamespaces (Mono.CSharp.CompilerContext ctx) [0x00000] in :0
at Mono.CSharp.Driver.LoadReferences () [0x00000] in :0
at Mono.CSharp.Driver.Compile () [0x00000] in :0
at Mono.CSharp.Driver.Main (System.String[ ] args) [0x00000] in :0
The following assembly referenced from C:\Users\tamar\Source\Workspaces\Einstein Junior\Unity\Assets\Plugins\LabMatePluginLayer.dll could not be loaded:
Assembly: System.Runtime (assemblyref_index=0)
Version: 4.0.20.0
Public Key: b03f5f7f11d50a3a
The assembly was not found in the Global Assembly Cache, a path listed in the MONO_PATH environment variable, or in the location of the executing assembly (C:\Users\tamar\Source\Workspaces\Einstein Junior\Unity\Assets\Plugins).
Could not load file or assembly ‘System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies.
Missing method .ctor in assembly C:\Users\tamar\Source\Workspaces\Einstein Junior\Unity\Assets\Plugins\LabMatePluginLayer.dll, type System.Runtime.Versioning.TargetFrameworkAttribute
Can’t find custom attr constructor image: C:\Users\tamar\Source\Workspaces\Einstein Junior\Unity\Assets\Plugins\LabMatePluginLayer.dll mtoken: 0x0a00000d
Not sure why doesn’t it recognizes the System.Runtime.
when i try to build, i get this error: “Error building Player: Extracting referenced dlls failed.”
and
in the library that my plugin references:
ArgumentException: The Assembly Newtonsoft.Json is referenced by Win10LabMateSDK (‘Assets/Plugins/WSA/Win10LabMateSDK.dll’).
But the dll is not allowed to be included or could not be found.
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List1 alreadyFoundAssemblies, System.String[ ] allAssemblyPaths, System.String[ ] foldersToSearch, System.Collections.Generic.Dictionary2 cache, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:156)
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List1 alreadyFoundAssemblies, System.String[ ] allAssemblyPaths, System.String[ ] foldersToSearch, System.Collections.Generic.Dictionary2 cache, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:162)
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List1 alreadyFoundAssemblies, System.String[ ] allAssemblyPaths, System.String[ ] foldersToSearch, System.Collections.Generic.Dictionary2 cache, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:162)
UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[ ] paths, System.String[ ] foldersToSearch, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:194)
UnityEditor.HostView:OnGUI()
how is the dll not allowed or not found?
Regarding 1), it seems Assets\Plugins\LabMatePluginLayer.dll is built against .NET 4+. Editor only supports assemblies built against up to .NET 3.5.
On 2), is Newtonsoft.Json.dll anywhere in your project? Unity cannot find it for some reason.
Notter
November 18, 2015, 5:27pm
3
Thanks for the help, I’ve manage to resolve the issue.
btw though, i’m 100% I’ve created the universal app library for .NET 3.5
but for some reason i guess it wasn’t 3.5, and i couldn’t change it either, there was no “change targets” button.
so i had to make a regular library.
I believe Visual Studio ignores the .NET setting when creating Universal App class libraries. So yea, you have to create " classic desktop class library" for the editor.