Getting IllegalFormatName exception in messageQueue.BeginReceive

378 views Asked by At

I am trying to create a eventhandler for a msmq message router and I almost just copied a online example from msdn library example 2.

But when I invoke messageQueue.BeginReceive() I get a IllegalFormatName exception.

  • I am using a private queue
  • Using VS 2015 on windows 10
  • Solution is using .Net 4.5.2
  • I got no problems sending messages to any of my private queues or reading from them if I use messageQueue.Receive()

Exception details below:

System.Messaging.MessageQueueException was unhandled
ErrorCode=-2147467259 HResult=-2147467259 Message=Formatnavnet er ugyldigt. Source=System.Messaging StackTrace: ved System.Messaging.MessageQueue.MQCacheableInfo.get_ReadHandle() ved System.Messaging.MessageQueue.ReceiveAsync(TimeSpan timeout, CursorHandle cursorHandle, Int32 action, AsyncCallback callback, Object stateObject) ved System.Messaging.MessageQueue.BeginReceive() ved MYFirstMSMQ.Program.Main(String[] args) in ......Visual Studio 2015\Projects\FirstQueue_bluff_city\ConsoleApplication1\Program.cs:linje 68 ved System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) ved System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) ved Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() ved System.Threading.ThreadHelper.ThreadStart_Context(Object state) ved System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) ved System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) ved System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) ved System.Threading.ThreadHelper.ThreadStart() InnerException:

Sorry about the Message - windows returns some messages in my native language

0

There are 0 answers