WCF in a Windows Service using Entity Framework

11. November 2010 18:40

Tried sending an enitity over a WCF service... got this....  

An error occurred while receiving the HTTP response to http://localhost:1337/MyService/service. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.

 

So, to fix it I used the Microsoft Trace Viewer on the service side to get to this error:

 

The ObjectContext instance has been disposed and can no longer be used for operations that require a connection.

 

The problem was that I was using a using statement around my DataEntities context and the service was trying to call out to the context before serializing but it found that it was disposed of already.  Removing the using{} clause fixed the problem.


blog comments powered by Disqus

Custom Development

ALL USA BASED DEVELOPERS

 

Coder For Rent is a one-stop shop for all your .Net programming needs.  We can make project-based fixed bids as well as hourly/weekly/monthly quotes.  Our goal is to meet your needs the first time, saving you time and money.

 

Call to speak with an account manager. We take projects of all sizes.

 

713-482-7155 

Contact Us

Call 713-482-7155 
for technical or purchasing support

Freshbooks Rocks

FreshBooks

Silverlight Gantt Chart Control
Silverlight Scheduler Control