I have the following simple code:
using UnityEngine;
using System;
using System.Messaging;
using System.IO;
using RabbitMQ;
using Mono.Messaging;
using Mono.Messaging.RabbitMQ;
namespace NB.src.ui {
public class NBMessage {
public void Init() {
Message msg = new Message();//build pass
if(!MessageQueue.Exists(".\\myQueue"))//error
{
MessageQueue.Create(".\\myQueue");
}
}
I get the following errors:
Unhandled Exception: System.TypeLoadException: Could not load type 'System.Messaging.MessageQueue' from assembly 'System.Messaging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
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
What might cause this and how do I solve it?