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

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

WCF and Enterprise Validation Block

Posted By:      Posted Date: October 19, 2010    Points: 0   Category :WCF
Hi All, I am in a development of a WCF service which is using WCF Enterprise Validation blocks. How can i  localize the messages in the Fault Exception. Thanks and Regards Viju

View Complete Post

More Related Resource Links

Using Enterprise Library 5.0 Validation Block with Linq to SQL classes


Could anyone show me how to configure the Enterprise Library 5.0 Validation Block with Linq to SQL classes?

Using the ConsoleTraceListener with the Enterprise Library 3.1 Logging Block


I'm new to using the Logging application block.  I think I have a pretty good handle on how things work.  However, I'm running into a problem.  I'm using the RollingFlatFileListener and I have formatted the logging template to be more like the logging we are replacing.  However, in our console apps when the ConsoleTraceListener is added it still logs it out in the default text template format.  Is there any way to get around this?  Currently it looks like I will have to create a new TraceListener called FormattedConsoleListener that allows a text formatter to be associated with it.  Is this the only way?

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

Data Points: The Enterprise Library Data Access Application Block, Part 3


E nterprise applications can have a wide variety of data update requirements. Sometimes you need to save multiple rows of changes at once within a single transaction. Other times, the user must be allowed to enter multiple rows of data, send them to the database in a batch; and if a row or two fails, only the rows that succeeded should be committed and remain committed.

John Papa

MSDN Magazine October 2005

Data Points: The Enterprise Library Data Access Application Block, Part 2


Last month I explored the foundation of the Enterprise Library Data Access Application Block (DAAB) including how it all fits into an architecture (see Data Points: The Enterprise Library Data Access Application Block, Part 1).

John Papa

MSDN Magazine August 2005

Data Points: The Enterprise Library Data Access Application Block, Part 1


A solid data access later (DAL) can benefit an application by hiding redundant tasks, helping handle exceptions more gracefully, helping clean up resources more efficiently, and providing a layer of abstraction from the database.

John Papa

MSDN Magazine July 2005

Enterprise library exception block

Hi experts, I am developing an application in two database Oracle & Sql Server, but i want to implement common Exception Handling for both dbs using Enterprise library please suggest me if possible   Thanks in advance

Validation from the Enterprise Library

Hello all, I have a question about validation.  Basically how the MVC framework is setup it can use DataAnnotations.  It calls TryValidate in a controller which does some other black magic, and poof, you have a ModelState with validation results.  Now to extend this validation you can create a validator and then provide custom validation on both server and client side.  Here is the problem... what if you dont want to hard code all of the validation in the classes?  I would like to use what Microsoft has already provided in the Enterprise Library (http://msdn.microsoft.com/en-us/library/ff650131.aspx) for validation.  I will be using both DataAnnotations and configured rule sets.  Of course I could just put the code in each action, but that is so 1999.  As I see it the MVC framework falls short by not allowing us to use the config for such things.  Why is the validation so specific for MVC?  Why could it now have used the Enterprise Validation?  I wrote my own abstract controller and put in Enterprise Library validation and it worked GREAT!!!  So why am I here?  Well, surly there must be a better way... do I really have to write my own controller abstract class to change the validation?So if you think you know how to solve this problem, you must provide a solution that does this:Uses DataAnnotations AND Configurati

Microsoft Enterprise Library 5.0 - Logging Application Block Activation Error


Hi folks,

I've been writing a class where I wanted to write the errors off to the OS EventLog. I was pointed towards the Logging Application Block. I used LogWriter successfully in a web page and transfer the code to the class so that I could have the functionality there.

I keep getting an {"Activation error occured while trying to get instance of type LogWriter, key \"\""} Error when I reach this line of code:

private LogWriter writer = EnterpriseLibraryContainer.Current.GetInstance<LogWriter>();

I had something similar with the daab getinstance call but I added the unity assemblies to the code and this resolved this. I thought this was the issue with this problem.

Could anyone tell me what I'm doing wrong?

Thanks in advance folks.

app.config code:


<?xml version="1.0" encoding="utf-8" ?>
        <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />

How to Validate a Method through Validation Application Block


Can i use Validation block  to apply check on Method parameter e.g. we have USerMasterBO as input parameter and we want to check if MasterID provide when user access a method GetUserDetail(), then only it should go to function else return before it because of validation fails.

In other words like we have validation feature in Message Inspector on API can we do the same in Validation block?


how to write wrapper for Data block of Enterprise library




I have the following scenario.

The project has 4 layers

1) Business Entities

2)Business Layer


all are separate projects
so lets say

1 )Business Entities has

public class Employee
public int EmpId{get;set;}
public string EmpName{get;set}
pullic int Age{get;set;}

2)Business layer will call dataacess layer

public class BusinessLayer

public int RegisterEmployee(Employee objEmp)
 Datalayer objDal =new Datalayer();


3)From the datalayer i need to call Wrapper for enterprise library and the requirement is
datalayer should not have any reference of Enterprise library data block(that i dont know how to do that)
Only the wrapper class should have reference for Enterprise library data block


public class Datalayer
 public int AddEmployee(Employee objEmp)
///Database db=DatabaseFactor.Createdatabase()
//the above line should not be in datalayer it should in some other componenent
//lets say component is wrapper
//i want to how to write wrapper for that.
//As well as how to build command and parameter



VseWSS 1.3 Deployment error related to Enterprise LIbrary(Exception Handling block)


We are getting the folllowing error while deploying VseWSS 1.3. There seems to be an issue with Exception Handling Block.

There no more detail in log file except for this error as shown below. We did a complete reinstall of VS 2008 and VseWSS and Enterprise Library, but the error persist.

Is there some incompatibility issue with VseWSS 1.3 and EL? Has anyone come across this error before:



Microsoft.SharePoint.Tools.Utilities.VSeWSSServiceException: VSeWSS Service Error: The current build operation (build key Build Key[Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyImpl, CommonErrorPolicy]) failed: Object reference not set to an instance of an object. (Strategy type ConfiguredObjectStrategy, index 2)


Log fil

Scale Up Enterprise Library Caching Application Block


CAB from MS is a very famous tool for the developers as it saves a lot of valuable time of the developers. But anyone who has decided to use CAB, should also keep into mind its limitations as well. The cache in EnltLib is stand alone and in-process in nature that’s why it can ends up with some scalability and reliability issues when used in a multi-server environment. But there are some party integrations which can over come this issue. The most popular way to overcome these limitations of CAB is the use of a distributed cache. The article about the drawbacks of CAB and it solutions can be a very helpful read in this regard. 

Help- Enterprise Library Logging Block (Database trace listener)



I'm new to enterprise application blocks. I'm trying to use database trace listener to write the logs to Database. Can someone help me on this .

I would apprciate your response.







MVC architecture in ASP.Net using C# and Microsoft Data Access Application block

The Model-View-Controller (MVC) pattern separates the modeling of the domain, the presentation, and the actions based on user input into three separate classes [Burbeck92]:

Model. The model manages the behavior and data of the application domain, responds to requests for information about its state (usually from the view), and responds to instructions to change state (usually from the controller).

View. The view manages the display of information.

Controller. The controller interprets the mouse and keyboard inputs from the user, informing the model and/or the view to change as appropriate.

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 ?





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