ArgumentException was not handled

Topics: Exception Handling Application Block
Mar 28, 2011 at 7:23 AM

Hi,

getting the following error can you please help me to reso;ve this

The type 'Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' cannot be resolved. Please verify the spelling is correct or that the full type name is provided.

 

Thankls,

Santosh

Mar 28, 2011 at 8:20 AM

Can you provide us additional details regarding when this exception is thrown? Also, can you check this thread if this relates to your problem?

 

Noel Angelo Bolasoc
Global Technologies and Solutions
Avanade, Inc.
entlib.support@avanade.com

Mar 28, 2011 at 9:15 AM

 

This happens when  try the follwoing code

// Resolve the default exception object from the container.
            using (_UnityContainer = new UnityContainer())
            {
                _UnityContainer.AddNewExtension<EnterpriseLibraryCoreExtension>();
            }

Now i am getting the following error after i followed wht was said in the link you sent.at the above place

An error occurred creating the configuration section handler for exceptionHandling: Exception has been thrown by the target of an invocation. (E:\Source\Manas\Manas\Exceptions\exceptionconfiguration.config line 8)

 

this is my exception.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <configSections>
        <section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
        <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
        <section name="enterpriseLibrary.ConfigurationSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
    </configSections>
    <exceptionHandling>
        <exceptionPolicies>
            <add name="CustodyPostingDataPolicy">
                <exceptionTypes>
                    <add name="All Exceptions" type="System.Exception, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
                        postHandlingAction="ThrowNewException">
                        <exceptionHandlers>
                            <add name="Logging Exception Handler" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                                logCategory="General" eventId="100" severity="Error" title="Enterprise Library Exception Handling"
                                formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling"
                                priority="0" />
                            <add name="Custody Posting Data Replace Handler" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ReplaceHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                                exceptionMessage="An Error Has occured in Data layer while processing&#xD;&#xA; your request. Please contract Help Desk Support at&#xD;&#xA; X-XXX-XXX-XXXX with Error Token ID {1}."
                                replaceExceptionType="Manas.Exceptions.ExceptionType.CustomException, Exceptions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
                        </exceptionHandlers>
                    </add>
                </exceptionTypes>
            </add>
        </exceptionPolicies>
    </exceptionHandling>
    <dataConfiguration defaultDatabase="LocalSqlServer" />
    <enterpriseLibrary.ConfigurationSource selectedSource="System Configuration Source">
        <sources>
            <add name="System Configuration Source" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.SystemConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
            <add name="LoggingConfigSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                filePath="E:\Source\Logging\logconfiguration.config" />
        </sources>
        <redirectSections>
            <add sourceName="LoggingConfigSource" name="loggingConfiguration" />
        </redirectSections>
    </enterpriseLibrary.ConfigurationSource>
</configuration>

 

Mar 28, 2011 at 11:39 AM

Hi,

Are you using .NET remoting? If yes, you can refer to this discussion. Also you can send us a small repro so we can further analyze the problem.

 

Noel Angelo Bolasoc
Global Technologies and Solutions
Avanade, Inc.
entlib.support@avanade.com