HI P.C.
Lindsey,
I just saw this post and thought I might chime in here.
First off, you don?t need to move those folders you mentioned into the LabVIEW
8.5 folder. I am not sure which KnowledgeBase Jason was referring to, but the
requirement for placing your .NET assemblies in the same folder as your
top-level VI is no longer valid in LabVIEW 8.0 and later. This was a
requirement for LabVIEW 7.x because we created an AppDomain for each top-level VI. In LabVIEW
8.0 and later, we create separate AppDomains for LabVIEW projects and thus it?s
recommended that any VI that uses .NET assemblies be part of a LabVIEW
project. Additionally, you will want to put any private .NET assemblies
you are using in the LabVIEW project directory or any of its subdirectories. As
a side note, we also store the relative path to the .NET assemblies (for
non-GAC assemblies) inside the VI so we do attempt to locate the assembly that
way as well if needed.
Now in your case, you don?t have to worry about placing .NET assemblies in the
project directory because you are referencing assemblies that live in the GAC.
To address your real question, by default when an instance of the MessageQueue is created, an instance of XmlMessageFormatter is created for you and it is
associated with the MessageQueue. By default, the XmlMessageFormater instance
can be used to write to the queue, but it cannot be used to read from the queue
until you set the TargetTypeNames property on the formatter. To do this, I created
a new instance of the formatter and set that value automatically by passing
them as arguments to the constructor.
Basically, the C# code that you will be doing would be something like:
myQueue.Formatter
= new XmlMessageFormatter(new Type[] {typeof(String)});
I have attached an image that shows how to do this in LabVIEW. I tested the VIs
out with my new addition and it worked fine.
Best Regards,
Formatter.jpg:
Loading Image...