How can i set messageTemplate from Configuration Tool?

Topics: General discussion, Validation Application Block
Oct 9, 2008 at 4:47 PM
Edited Oct 9, 2008 at 5:12 PM
I am using VAB via configuration tool I am struggling to make the it work.

Assembly: MyCompany.Customer.dll
ResourceFile Name:Resources
Name In ResourceFile=UseIdNotValid

How I set it up in configurationTool:
MessageTemplate= Empty
MessageTemplateResourceTypeName  =MyCompany.Customer.Properties.Resources, MyCompany.Customer, Version=, Culture=neutral, PublicKeyToken=null

I know it's wrong what is the way to set it up?
It's driving crazy.I also have a feeling that you cannot pick up the resource file and must be manually typed.

thanks a lot in advance
Oct 10, 2008 at 5:15 AM
Edited Oct 10, 2008 at 5:16 AM

Please check your name spaces in the resources.dessigner.cs. Also you can check this post, this has sample file attachment that can help.

I downloaded the attached file and try to put the resources inside the property folder, at first i cant make it work,
but when i check the namespaces and fix them, it now works.


Oct 10, 2008 at 6:19 AM
Edited Oct 10, 2008 at 6:19 AM
Hi Kratos,
It sort of works but it doesnt pick up the message from the resource file.It should show "Coming from ResourceFile" but it shows the message that the EL puts by default "The length of the value must fall within etc...."
I am LOST!!!!!!

What I did
  1. Created a Class Library called "MyCompany.Customer"
  2. Added a customerClass  1 property string name
  3. Added A Console Application called "ConsoleELLocalization"
  4. Added an App.Config
  5. 01 Rule(Default)Name lower bound 1-10 inclusive
  6. In the Default properties.resources of this project added as string NameNotValid with message "Coming from Resource File"
  7. MessageTemplateResourceName=NameNotValid
  8. MessageTemplateResourceTypeName=ConsoleELLocalization.Properties,ConsoleELLocalization, Version=, Culture=neutral, PublicKeyToken=null    

Can you or anybody explain what I am doing wrong?
thanks alot
Oct 10, 2008 at 6:54 AM
Hi Brix,

I tried your steps and have it worked.

In step #8 it should be 
MessageTemplateResourceTypeName=ConsoleELLocalization.Properties.[Name of the Resource File],ConsoleELLocalization, Version=, Culture=neutral, PublicKeyToken=null    

By the way, do you manually add the Resource file? co'z i just added the resource file in the ConsoleApp.


Oct 10, 2008 at 3:26 PM

Hi thanks for your time.
It worked for me too .I was missing "Name of the ResourceFile".I was using the one that is generated when you go to properties of your project and click resources.

thanks again