Hello all,
Here is the issue.
I am working on a senior project for my BS in CSET. I have built a prototype AI decision engine. It uses 2 class libraries built in .net 4 with C#. The premise is to send requests to the engine from an external system like unity and receive actions back.
I have recompiled the External Interface library using .net 3.5.1 and the RX added references Tasks and ConcurrentQueues. This compiles fine in both VS 2008 and Mono which came with Unity.
My problem is accessing the assembly from a script. I can create the script with using External_Interface_Lib and both VS and Mono see the classes in the library and let me reference them. I can build the scripts without errors. However when I go back to unity, I have a compile error.
Internal compiler error. See the console log for more information. output was:
Unhandled Exception: System.TypeLoadException: Could not load type ‘External_Interface_Lib.External_Interface’ from assembly ‘AI_External_Interface_2008, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’.
With the stack trace of:
at (wrapper managed-to-native) System.MonoType:GetMethodsByName (string,System.Reflection.BindingFlags,bool,System.Type)
at System.MonoType.GetMethods (BindingFlags bindingAttr) [0x00000] in :0
at Mono.CSharp.MemberCache.AddMethods (BindingFlags bf, System.Type type) [0x00000] in :0
at Mono.CSharp.MemberCache.AddMethods (System.Type type) [0x00000] in :0
at Mono.CSharp.MemberCache…ctor (IMemberContainer container) [0x00000] in :0
at Mono.CSharp.TypeHandle…ctor (System.Type type) [0x00000] in :0
at Mono.CSharp.TypeHandle.GetTypeHandle (System.Type t) [0x00000] in :0
at Mono.CSharp.TypeHandle.GetMemberCache (System.Type t) [0x00000] in :0
at Mono.CSharp.TypeManager.MemberLookup_FindMembers (System.Type t, MemberTypes mt, BindingFlags bf, System.String name, System.Boolean used_cache) [0x00000] in :0
at Mono.CSharp.TypeManager.RealMemberLookup (System.Type invocation_type, System.Type qualifier_type, System.Type queried_type, MemberTypes mt, BindingFlags original_bf, System.String name, IList almost_match) [0x00000] in :0
at Mono.CSharp.TypeManager.MemberLookup (System.Type invocation_type, System.Type qualifier_type, System.Type queried_type, MemberTypes mt, BindingFlags original_bf, System.String name, IList almost_match) [0x00000] in :0
at Mono.CSharp.Expression.MemberLookup (Mono.CSharp.CompilerContext ctx, System.Type container_type, System.Type qualifier_type, System.Type queried_type, System.String name, MemberTypes mt, BindingFlags bf, Location loc) [0x00000] in :0
at Mono.CSharp.Expression.MemberLookupFinal (Mono.CSharp.ResolveContext ec, System.Type qualifier_type, System.Type queried_type, System.String name, MemberTypes mt, BindingFlags bf, Location loc) [0x00000] in :0
at Mono.CSharp.New.DoResolve (Mono.CSharp.ResolveContext ec) [0x00000] in :0
at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec, ResolveFlags flags) [0x00000] in :0
at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec) [0x00000] in :0
at Mono.CSharp.Assign.DoResolve (Mono.CSharp.ResolveContext ec) [0x00000] in :0
at Mono.CSharp.SimpleAssign.DoResolve (Mono.CSharp.ResolveContext ec) [0x00000] in :0
at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec, ResolveFlags flags) [0x00000] in :0
at Mono.CSharp.Expression.Resolve (Mono.CSharp.ResolveContext ec) [0x00000] in :0
at Mono.CSharp.ExpressionStatement.ResolveStatement (Mono.CSharp.BlockContext ec) [0x00000] in :0
at Mono.CSharp.StatementExpression.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in :0
at Mono.CSharp.Block.Resolve (Mono.CSharp.BlockContext ec) [0x00000] in :0
at Mono.CSharp.ToplevelBlock.Resolve (Mono.CSharp.FlowBranching parent, Mono.CSharp.BlockContext rc, Mono.CSharp.ParametersCompiled ip, IMethodData md) [0x00000] in :0
Not sure what is going on here. I’ve searched the forums for help but don’t see anything. My script is pretty basic.
using UnityEngine;
using System.Collections;
using External_Interface_Lib;
public class AI_Engine_Interface : MonoBehaviour{
// Use this for initialization
void Start () {
External_Interface extInt = new External_Interface();
extInt.StartReceiving();
extInt.StartSending();
}
// Update is called once per frame
void Update () {
}
}
Anyone have any ideas?