我想知道是否有办法以编程方式检查使用C#在私有或公共MSMQ中有多少消息?我有代码,使用try/catch中包含的peek方法检查队列是否为空,但我从未见过有关显示队列中消息数的任何信息.这对于监视是否正在备份队列非常有用.
有没有人知道如何在Visual Studio 2010中添加对"C:\ Windows\SysWOW64\mqoa30.tlb"的引用,就像在Visual Studio 2008中一样?
如果我转到添加引用,并浏览到此文件:"C:\ Windows\SysWOW64\mqoa30.tlb"这些是不同的结果:
Visual Studio 2008

添加就好了
并创建Interop的东西
Visual Studio 2010
搜索引擎优化的明文错误信息:
Could not add a reference to C:\Windows\SysWOW64\mqoa30.tlb
Could not load file or assembly 'mqoa30.tlb' or one of its dependencies. The module was expected to contain an assembly manifest.
This file may not be a managed assembly.
Run Code Online (Sandbox Code Playgroud)
无法从"添加引用"对话框中添加,并且"Microsoft Messaging Queue 3.0类型库"未在COM类型库中列出.
(注意:我安装了MSMQ并且工作正常(通过NServiceBus).我正在运行Windows 7.)
如果您知道如何添加参考,请告诉我?