.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

MSMQ - Queue Validation

Posted By:      Posted Date: September 06, 2010    Points: 0   Category :.NET Framework
Hi Folks, does anyone know a way of checking that the creation of a private message queue (or attaching to an already existsing message queue) has actually worked? In my program, I create an instance of the MessageQueue class tied to an existing queue by calling the MessageQueue constructor with a 'Format Name' string I've constructed. The string includes the queue name which I extract from a config file. This all works well as long as the queue name is correct. If, however, the referenced queue does not exist then I was expecting the constructor to throw an exception. Unfortunately, it doesn't do this. So, I've tried accessing some of the members of the MessageQueue class after the constructor has executed. In some circumstances accessing MessageQueue.FormatName caused an exception but in other circumstances it didn't. Is there any definitive, fool-proof way of determining an instance of a MessageQueue class is connected to a valid queue? Many thanks, RobDev

View Complete Post

More Related Resource Links

Newbie Can a HTTP client recieve MSMQ messages from a queue?


Can a HTTP client recieve MSMQ messages from a queue?

Thats the question. I see examples on sending messages via HTTP but how do I get messages via HTTP from a queue.

If it supports getting messages via HTTP is it a normal get HTTP request that would be blocked by a firewall or ??




MSMQ: what is the real limit of private queue name length (.NET 2.0)?


I ran across am unexpected behavior of MSMQ (XP/2003, .NET 2.0), when queue name longer that some limit does not work.

I fount this: http://msdn.microsoft.com/en-us/library/ms706083(v=VS.85).aspx, which states that maximum is 124.

My working queues are ~70 characters long; working with no issues.

If queue name length is 108 characters I get the following:

1. Attempt to open queue results in The queue does not exist or you do not have sufficient permissions to perform the operation.

2. Attempt to create queue results in Format name buffer supplied to the API was too small to fit the format name.

3. In both cases above exception is thrown by the same method: System.Messaging.MessageQueue.ResolveFormatNameFromQueuePath

4. Queue is in fact created with full non-truncated name.


So what's the name limit for private queue name?

Does this limit include machine name?  My queue names (which I count characters in) look like .\Private$\ABCDEF...



Secure messages via MSMQ queue when using local system and local user accounts


I am trying to send a message to a WCF service via a private MSMQ queue.  With security turned off, there's no problem.  With security turned on and using a normal user account (one registered with the Active Directory) to send messages, there's no problem.  However, if I use either the local system account or a local user account, it fails.

If I use a local user account it fails with the message:

Unhandled Exception: System.ServiceModel.MsmqException: An error occurred while sending to the queue: Unrecognized error -1072824272 (0xc00e0030).Ensure that MSMQ is installed and running. If you are sending to a local queue, ensure the queue exists with the required access mode and authorization.

If I use the local system account, no exception is thrown, but nothing is delivered to the service, and the queue remains empty.

Both "Everyone" and SYSTEM have permissions to "Get Properties", "Get Permissions" and "Send Message" as regards the private queue.

I am thinking there must be an issue with the queue failing to authenticate the users in the Active Directory, but given it's a private queue, I didn't think it would do that?

I seem to be having the same problems as a previous

Server side validation of Fileupload control not working



I've tried this method in my code behind to try and validate that the Fileupload control has a file or not. I get the error message the the event "Server Validate" cannot be found. Can anyone tell why? Thanks.

Public Sub CustomValidator1_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles CustomValidator1.ServerValidate

' Get file name

        Dim uploadAvatar As FileUpload = DirectCast(AdvertisementForm.FindControl("uploadAvatar"), FileUpload)

        Dim UploadFileName As String = uploadAvatar.PostedFile.FileName

        If UploadFileName = "" Then
            ' There is no file selected
            args.IsValid = False
            Dim Extension As String = UploadFileName.Substring(UploadFileName.L

Integer Validation



I need to make validation for Textbox to allow enter integer stated by 9 or 6 or 5 , and also maximum 8 digits , how to do that ?





VS 2010 HTML validation "in CSS" option - where the hell is it?


In VS 2008 there is a very useful feature of background HTML validation - it checks if CSS class name is valid i.e. it exists in one of the linked css files. But VS 2010 Express does not do that any more. And the relevant setting in Options->Text Editor->HTML->Validation->in CSS is not there. Ok, maybe they made it paid for option? VS 2010 Professional? Not there. Or maybe VS 2010 Ultimate? Not a trace.

1. am I blind?

2. they decided it is too convenient to use and removed it?

3. they will "introduce" it in SP1?

What is going on? That one thing made me move back to VS 2008 web developer.


User validation Issue in xlsx file



I am validating user from Login.xlsx file. It was working fine by validating email and password from that file. For testing i got new file same contents of file but added some more user names.

So after that when i validating the user i am getting the following error "Data type mismatch in criteria expression".

But when i replaced the new to old one it is working fine. The contens of both files are the same. So why this kind of error happened.


set messageTemplateResourceName from resource file in Validation appication block.



  I am using Validation application block in my project and want to set validation message from resource file, but not able to do that. I tried giving the path of resource file in messageTemplateResourceType and name of resource in messageTemplateResourceName. But it did not help as I only receive the message if I have set something in messageTemplate even after setting the resource file.

Here is my code:

<validator lowerBound="1" lowerBoundType="Inclusive" upperBound="250"
              upperBoundType="Inclusive" negated="false" messageTemplate=""
              messageTemplateResourceType="Asurion.jCare.Common.Resources.UIResources.PerilTypeAndDetailsSection, Asurion.jCare.Common.Resources, Version=, Culture=neutral, PublicKeyToken=null"
              tag="" type="Microsoft.Practices.EnterpriseLibrary.Validation.Validators.StringLengthValidator, Microsoft.Practices.Enterpris

Localize framework message from xml validation error


I need to validate an XML through XSD. I am using XMLReader (with XmlReaderSettings and 

Validation_EventHandler to do it). Depend on users preference, I would like to change the output message generated by  Validation_EventHandler in french or english.

Any idea on how to perform this?





Input Validation: Enforcing Complex Business Data Rules with WPF


Windows Presentation Foundation has a rich data binding system that includes flexible support for business data validation. We take a look at implementing some complex data input validation scenarios that include customized data errors for users.

Brian Noyes

MSDN Magazine June 2010

Extreme ASP.NET: Model Validation & Metadata in ASP.NET MVC 2


Scott Allen shows how to improve your user input validation with new features coming out in ASP.NET MVC 2 that easily allow validation on both the client and server.

Scott Allen

MSDN Magazine March 2010

Data Points: Data Validation with Silverlight 3 and the DataForm


In this month's column, John Papa shows you how the DataForm control works and how it can be customized.  He presents in detail a sample application that uses several features to bind, navigate, edit and validate data using the DataForm.

John Papa

MSDN Magazine October 2009

C++ at Work: Form Validation with Regular Expressions in MFC


I thought I'd use this month's column to describe an interesting app I built using the RegexWrap library described in my article "Wrappers: Use Our ManWrap Library to Get the Best of . NET in Native C++ Code" in this issue.

Paul DiLascia

MSDN Magazine April 2005

Design Patterns: Simplify Distributed System Design Using the Command Pattern, MSMQ, and .NET


Service-oriented architecture is a great framework when you need to perform distributed computing tasks over the Internet. But when you want to perform processing inside your local network, a different solution may provide a better fit. That solution, based on the Command pattern, uses Windows services and Microsoft Message Queuing to implement a queued system that meets your needs better than a service-oriented solution. This article explains how to build it.

Brad King

MSDN Magazine September 2004

MSMQ and .NET: Send MSMQ Messages Securely Across the Internet with HTTP and SOAP


When creating a distributed system you frequently need to provide for communication between two entities that are not in sync. Microsoft Message Queue Server (MSMQ) provides the kind of store-and-forward messaging in a pre-built infrastructure that can help you address these kinds of messaging needs. In the past, MSMQ was accessed using a COM wrapper. Now there's a .NET wrapper that lets you accomplish your messaging goals easily from your Framework-based code. To illustrate the use of the wrapper, the author builds a messaging application, sends MSMQ messages over the Web, and discusses messaging security.

David S. Platt

MSDN Magazine December 2003

Web Services: Extend the ASP.NET WebMethod Framework with Business Rules Validation


In an earlier article the authors showed how to build a custom WebMethods extension that provides XML Schema validation, a function that is lacking in ASP.NET. In the process they established a foundation for enforcing business rules during the deserialization of XML data. The technique, which is described in this article, uses declarative XPath assertions to test business rule compliance.In building this business rules validation engine, the authors integrate the validation descriptions into the WSDL file that is automatically generated by the WebMethod infrastructure. Finally, they demonstrate how to extend wsdl.exe, the tool that generates WebMethod proxy/server code from WSDL files, to make use of their extensions.

Aaron Skonnard and Dan Sullivan

MSDN Magazine August 2003

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend