Getting error " 'ValidationBlockExtension' was not found"

Topics: Logging Application Block, Silverlight Integration Pack
Mar 8, 2012 at 10:37 AM

Hi,

I am using Logging Application block in silverlight by making use of the Silverlight Integration Pack and EntLib 5.

I have resolved the LogWriter object through the EntLib container and the line at which I resolve it I am getting the following error:

The type 'ValidationBlockExtension' was not found because 'clr-namespace:Microsoft.Practices.EnterpriseLibrary.Validation.Configuration.Unity;assembly=Microsoft.Practices.EnterpriseLibrary.Validation.Silverlight' is an unknown namespace.

Here is the code:

public class MessageLog
    {
        string strNamespace, strClass;
        LogEntry entry;
        LogWriter writer;

        public MessageLog(string strNamespaceName, string strClassName)
        {
            strNamespace = strNamespaceName;
            strClass = strClassName;
            entry = new LogEntry();
	//GETTING ERROR AT BELOW LINE
            writer = EnterpriseLibraryContainer.Current.GetInstance<LogWriter>();
        }
. . . 
   }

 

I have not made use of the Validation Block at all. So I dont know why I am getting that error. In any case I tried adding the reference Microsoft.Practices.EnterpriseLibrary.Validation.Silverlight but it still gave the error. 

The same code works fine on other machines. I am using Microsoft Windows XP professional version2 Service pack3.

Can anyone help with this please. Any idea why this error occurs?

Thanks in advance.

Mar 9, 2012 at 6:46 AM

The message looks to be a XamlParseException.

Enterprise Library does try to load the ValidationBlockExtension by name at runtime so that could be where the error is occurring.  However, it looks like it catches a XamlParseException, swallows the exception and returns null so I wouldn't expect that exception to propagate.  

I haven't seen that exception before -- can you create a project to reproduce the problem that you can post?

--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com 

Mar 9, 2012 at 7:16 AM

Hi Randy

Thanks for your reply. Will try to see if I can create a project.

One question - when installing the EntLib 5 and EntLib SL Integration Pack on the XP machine, I have used the installables 'Enterprise Library 5.0 Optional Update 1' and 'Enterprise Library 5.0 Silverlight Integration Pack'.

There are also source code installables viz. 'Enterprise Library 5.0 Optional Update 1 - Source Code' and 'Enterprise Library 5.0 Silverlight Integration Pack - Source Code'. Is it mandatory to install these too? I have a machine using Windows7 where I have installed both source code installables and the other ones. I am facing no problem there. So I was wondering if this might be a problem with the installation.

May 28, 2012 at 4:59 PM

i found that disabling "just my code" from the debug settings in vs 2010 allowed me to ignore this error and keep working. Obviously not ideal, but when needs must.

Feb 20, 2015 at 6:41 PM
I was getting this error and resolved it by adding a reference to "Microsoft.Practices.EnterpriseLibrary.Validation.Silverlight.dll" in my silverlight project.