enterprise library 5.0 exception handling -- config file

Topics: Enterprise Library Core, Exception Handling Application Block
Jun 4, 2011 at 11:44 AM

<add name="All Exceptions" type="System.Exception, mscorlib, Version=2.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" />
                        </exceptionHandlers>
                    </add>
                </exceptionTypes>

is there some reason if we are targeting 4.0 as the runtime that mscorlib version 2.0.0.0 is being targeted? My understanding was that there was an mscorlib for each version of the framework (and if we look in the 4.0 directory we do indeed find a 4.0 version of mscorlib. This is leading to a number of dll load failures as the 2.0 version cannot be loaded. and a thread that I found on suzanne cooks blog indicates that you cannot reference older versions of mscorlib from another version of the framework.

Insight welcome.

Jun 6, 2011 at 2:24 AM

Hi,

We tested it in Visual Studio 2010 and it is referencing the version 4.0 by default. We changed the reference to version 2.0 and surprisingly, the Exception Handling still works. We are not aware of any implications that this might bring since its more of a framework specific rather than EntLib.

 

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

Jun 17, 2011 at 8:07 PM

But even under the current version 5.x arbitrary versions of mscorlib and system are defined in the generated config files that do not match the current runtime framework 4.0 as opposed to 2.0 the issue that we see somthing like this

Timestamp: 6/17/2011 6:26:56 PM
Message: An error occured in GeneralHomePresenter.RefreshWorkspaces(): The current build operation (build key Build Key[Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyImpl, ConfiguratorGeneral]) failed: The type 'System.Configuration.ConfigurationException, System' cannot be resolved. Please verify the spelling is correct or that the full type name is provided. (Strategy type ConfiguredObjectStrategy, index 2)
Category: General
Priority: -1
EventId: 0
Severity: Error

and according to fusion it cannot load the system assembly.