Enterprise Services raised exception when using exception handling appliation block

Topics: Building and extending application blocks, Caching Application Block , Cryptography Application Block, Data Access Application Block, Enterprise Library Core, Exception Handling Application Block, General discussion, Logging Application Block, Policy Injection Application Block, Pre-release discussions, Security Application Block, Validation Application Block
May 7, 2008 at 4:55 PM
Hi all,

i m facing problem while developing Enterprise Service (COM) Component using Enterprise Library. it works fine when is register my Enterprise Service (COM) Component as LIbrary Application but throws "Refecence not set to an instannse of an object" Exception when registered as Server Application.

It just happens only when i use any application block of enterprise Library

The stace Trace and exception is as follows

----------------------------------------
General Error: 100 : Timestamp: 5/7/2008 4:51:03 PM
Message: HandlingInstanceID: 9ae9ec48-0a93-4288-bac1-690c573d8420
An exception of type 'Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionHandlingException' occurred and was caught.
----------------------------------------------------------------------------------------------------------------------------------
05/07/2008 21:51:03
Type : Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionHandlingException, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=3.1.0.0, Culture=neutral, PublicKeyToken=1214c04b59a38604
Message : Object reference not set to an instance of an object.
Source : Microsoft.Practices.EnterpriseLibrary.ExceptionHandling
Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite : Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyImpl GetExceptionPolicy(System.Exception, System.String, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyFactory)
Stack Trace :
Server stack trace:
at Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicy.GetExceptionPolicy(Exception exception, String policyName, ExceptionPolicyFactory factory) in E:\Waqas\My Work\Distributed Transaction Demo\ExtSrc\ExceptionHandling\ExceptionPolicy.cs:line 133
at Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicy.HandleException(Exception exceptionToHandle, String policyName, ExceptionPolicyFactory policyFactory) in E:\Waqas\My Work\Distributed Transaction Demo\ExtSrc\ExceptionHandling\ExceptionPolicy.cs:line 69
at Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicy.HandleException(Exception exceptionToHandle, String policyName) in E:\Waqas\My Work\Distributed Transaction Demo\ExtSrc\ExceptionHandling\ExceptionPolicy.cs:line 64
at EnterpriseServicesProject.EnterpriseServicesDemo.InvokeTransaction() in E:\Waqas\My Work\Distributed Transaction Demo\EnterpriseServicesProject\EnterpriseServicesDemo.vb:line 32
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)

Exception rethrown at 0:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at EnterpriseServicesProject.EnterpriseServicesDemo.InvokeTransaction()
at DistributedTransactionDemo.DTDemo.btnBeginTrans_Click(Object sender, EventArgs e) in E:\Waqas\My Work\Distributed Transaction Demo\DistributedTransactionDemo\DTDemo.vb:line 28

Additional Info:

MachineName : ASD170
TimeStamp : 5/7/2008 4:51:03 PM
FullName : Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=3.1.0.0, Culture=neutral, PublicKeyToken=1214c04b59a38604
AppDomainName : DistributedTransactionDemo.exe
ThreadIdentity : ASDLHR\WaqasAziz
WindowsIdentity : ASDLHR\WaqasAziz
Inner Exception
---------------
Type : System.NullReferenceException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : Object reference not set to an instance of an object.
Source : Microsoft.Practices.EnterpriseLibrary.ExceptionHandling
Help link :
Data : System.Collections.ListDictionaryInternal
TargetSite :
Stack Trace : at Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionHandlingConfigurationView.GetExceptionPolicyData(String policyName) in E:\Waqas\My Work\Distributed Transaction Demo\ExtSrc\ExceptionHandling\ExceptionHandlingConfigurationView.cs:line 67
at Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyCustomFactory.GetConfiguration(String id, IConfigurationSource configurationSource) in E:\Waqas\My Work\Distributed Transaction Demo\ExtSrc\ExceptionHandling\ExceptionPolicyCustomFactory.cs:line 66
at Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicyCustomFactory.CreateObject(IBuilderContext context, String name, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache) in E:\Waqas\My Work\Distributed Transaction Demo\ExtSrc\ExceptionHandling\ExceptionPolicyCustomFactory.cs:line 38
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfiguredObjectStrategy.BuildUp(IBuilderContext context, Type t, Object existing, String id) in E:\Waqas\My Work\Distributed Transaction Demo\ExtSrc\Common\Configuration\ObjectBuilder\Extensions\ConfiguredObjectStrategy.cs:line 62
at Microsoft.Practices.ObjectBuilder.SingletonStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild)
at Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfigurationNameMappingStrategy.BuildUp(IBuilderContext context, Type t, Object existing, String id) in E:\Waqas\My Work\Distributed Transaction Demo\ExtSrc\Common\Configuration\ObjectBuilder\Extensions\ConfigurationNameMappingStrategy.cs:line 55
at Microsoft.Practices.ObjectBuilder.BuilderBase`1.DoBuildUp(IReadWriteLocator locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[] transientPolicies)
at Microsoft.Practices.ObjectBuilder.BuilderBase`1.BuildUp(IReadWriteLocator locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[] transientPolicies)
at Microsoft.Practices.ObjectBuilder.BuilderBase`1.BuildUpTTypeToBuild(IReadWriteLocator locator, String idToBuild, Object existing, PolicyList[] transientPolicies)
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUpT(IReadWriteLocator locator, String id, IConfigurationSource configurationSource) in E:\Waqas\My Work\Distributed Transaction Demo\ExtSrc\Common\Configuration\ObjectBuilder\EnterpriseLibraryFactory.cs:line 176
at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.LocatorNameTypeFactoryBase`1.Create(String name) in E:\Waqas\My Work\Distributed Transaction Demo\ExtSrc\Common\Configuration\ObjectBuilder\LocatorNameTypeFactoryBase.cs:line 76
at Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicy.GetExceptionPolicy(Exception exception, String policyName, ExceptionPolicyFactory factory) in E:\Waqas\My Work\Distributed Transaction Demo\ExtSrc\ExceptionHandling\ExceptionPolicy.cs:line 109


Category: General
Priority: 0
EventId: 100
Severity: Error
Title:Enterprise Library Exception Handling
Machine: ASD170
App Domain: DistributedTransactionDemo.exe
ProcessId: 2572
Process Name: E:\Waqas\My Work\Distributed Transaction Demo\DistributedTransactionDemo\bin\Debug\DistributedTransactionDemo.exe
Thread Name:
Win32 ThreadId:5764
Extended Properties:
----------------------------------------


Please reply me as soon as possible
May 8, 2008 at 4:44 AM
Please Help mw as soon as possible. I am in despirate need of this solution.


Thanks in advance
May 15, 2008 at 9:48 PM

What's the OS version? I think I recall an issue with config files in server applications; I'll try to refresh my memory.

Fernando


cancarian88 wrote:
Please Help mw as soon as possible. I am in despirate need of this solution.


Thanks in advance



May 15, 2008 at 10:32 PM
If you're using Windows Server 2003 or higher, try this.

cancarian88 wrote:
Please Help mw as soon as possible. I am in despirate need of this solution.


Thanks in advance