FaultException on Validation.Validate(some object) Title is required

Topics: Enterprise Library Core, General discussion, Validation Application Block
Mar 1, 2010 at 4:21 PM

Hello,

For some reason or another I am getting this strange error.

System.ServiceModel.FaultException`1 was unhandled
Message="Method 'CreateObject' in type 'Microsoft.Practices.EnterpriseLibrary.Validation.Instrumentation.ValidationInstrumentationListenerCustomFactory' from assembly 'Microsoft.Practices.EnterpriseLibrary.Validation, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation."

I am currently using a WCF to house my Validation calls right now and whenever I make a call into a public method; Validate(...), inside my WCF, once I get to the line where I am making my Validation.Validate(some object), a fault exception is thrown. Its very bizarre, because I have been running my service and calling this same method for awhile now without any trouble. Does anyone have an idea as to why this is happening now? Any help would be appreciated.

Mar 1, 2010 at 9:28 PM

For clarification here is the full error:

System.TypeLoadException was unhandled by user code

  Message="Method 'CreateObject' in type 'Microsoft.Practices.EnterpriseLibrary.Validation.Instrumentation.ValidationInstrumentationListenerCustomFactory' from assembly 'Microsoft.Practices.EnterpriseLibrary.Validation, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'does not have an implementation."

  Source="Microsoft.Practices.EnterpriseLibrary.Validation"

  TypeName="Microsoft.Practices.EnterpriseLibrary.Validation.Instrumentation.ValidationInstrumentationListenerCustomFactory"

  StackTrace:

       at Microsoft.Practices.EnterpriseLibrary.Validation.ConfigurationValidatorBuilder.InitializeInstrumentationListener()

       at Microsoft.Practices.EnterpriseLibrary.Validation.ConfigurationValidatorBuilder..ctor(IConfigurationSource configurationSource)

       at Microsoft.Practices.EnterpriseLibrary.Validation.ValidationFactory.InnerCreateValidatorFromConfiguration(Type targetType, String ruleset, IConfigurationSource configurationSource)

       at Microsoft.Practices.EnterpriseLibrary.Validation.ValidationFactory.CreateValidator[T](String ruleset, IConfigurationSource configurationSource, Boolean cacheValidator)

       at Microsoft.Practices.EnterpriseLibrary.Validation.ValidationFactory.CreateValidator[T]()

       at Microsoft.Practices.EnterpriseLibrary.Validation.Validation.Validate[T](T target)

       at NGC.BamsUas.MissionPlanning.NavigationValidation.Services.ValidateNavPlanService.Validate(VehicleInfo pVehicleInfo, Route pRouteInfo, ValidityMask pValidityMask)

       at SyncInvokeValidate(Object , Object[] , Object[] )

       at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)

       at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)

  InnerException:

 

 

Mar 2, 2010 at 6:07 AM

Hi,

Is this the same error that your inquring here? http://entlib.codeplex.com/Thread/View.aspx?ThreadId=51870

Valiant Dudan
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com

Mar 2, 2010 at 12:30 PM
No, this one was caused because I was not putting the Validation and Common dll in the gac with our strong name key. I think I've fixed that now. However, I believe I will need to gac ObjectBuilder2 dll too right? I see one in the list of .NET dlls that can be referenced, but I am not sure if I should be referencing that particular one.


From: [email removed]
To: [email removed]
Date: Mon, 1 Mar 2010 23:07:49 -0800
Subject: Re: FaultException on Validation.Validate(some object) Title is required [entlib:203436]

From: AvanadeSupport
Hi,
Is this the same error that your inquring here? http://entlib.codeplex.com/Thread/View.aspx?ThreadId=51870
Valiant Dudan
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com
Read the full discussion online.
To add a post to this discussion, reply to this email (entlib@discussions.codeplex.com)
To start a new discussion for this project, email entlib@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com
Mar 2, 2010 at 12:54 PM

Hello Valiant,

Ok, I went ahead and copied the ObjectBuilder2.dll from "C:\EntLib41Src\bin" to where the rest of my dlls live after they have been compiled and put in the gac; "C:\Program Files\TestApp\bin\". I didn't try and gac the ObjectBuilder2.dll just so you know. This seemed to have eliminated the error; Message="Method 'CreateObject' in type 'Microsoft.Practices.EnterpriseLibrary.Validation.Instrumentation.ValidationInstrumentationListenerCustomFactory' from assembly 'Microsoft.Practices.EnterpriseLibrary.Validation, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'does not have an implementation, BUT the Validation.Validate(...) still does not return any error messages and IsValid flag is always true no matter what data I enter. How should I proceed from here, I am at a lost at this point once again.

Mar 3, 2010 at 12:41 AM
Edited Mar 3, 2010 at 12:45 AM

Where are your validation rules configured? Did you use attributes or set it in the config file?  If it is in the config file, you just probably didn't set the default Rule Set for that specific type you are validating.

By the way, you don't need to GAC any entlib assemblies.  Why are you using the unsigned ones?  Did you modify the source code?  If not, you should use the ones from the installation folder (C:\Program Files\Microsoft Enterprise Library 4.1 - October 2008\Bin).   And make sure that your project entlib references Copy Local property is set to true.

 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com