tags:

views:

24

answers:

0

I have a service that retrieves data from a SQL server using Entity Framework. Most of the time it works fine but sometimes it fails with a

The requested service XXXXXXXXXXXXXXXXXXX could be activated." error. To be able to see whats wrong, I have enabled tracing and checked with svctraceviewer. And found out that there is a nullreference exception thats shown ... below are the details of the error I am seeing...

Exception Type: System.ServiceModel.ServiceActivationException, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Message: The service '/bookadventurewcf/CommonService.svc' cannot be activated due to an exception during compilation. The exception message is: Object reference not set to an instance of an object..

Stack Trace: System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath) System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest() System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest() System.ServiceModel.Activation.HostedHttpRequestAsyncResult.OnBeginRequest(Object state) System.ServiceModel.Channels.IOThreadScheduler.CriticalHelper.WorkItem.Invoke2()

and so on

So its failing at EnsureServiceAvailable with an Object Refenence not set to an instance of an object.
I am not able to figure out whats causing the error Could any of you help me?