I'm trying this question one more time since I realized the work in in a 64-bit environment.
I have a WCF service which runs in production in a 32-bit environment using VS2008 and .NET 2.0.
We made a big change to our environment (lots at the same time) and I moved the services to VS2010, .NET 4.0, and 64-bit processes. I wrote a new service and deployed it under IIS. If I browse to the service I get the example screen and clicking
on the link gives me the metadata. So all of that is working.
In my services I create a Linq to SQL context, perform a query, then return the result set as an Array. I wrapped the context creation with a using. My tests returned an exception "Attempt to access an object that has already been disposed".
I traced it down and found that the code executes, forces the query, returns the results, exits the using statement (disposing the context properly) then exits the method. The next thing I get is the exception, inside framework code, and it is linq code
attempting to fulfill the query once again.
I have searched until I'm blue in the face trying to find prior incidents and fixes but all I found was one post, two years ago, same problem with less debugging, and no answer to the problem other than 'don't use the using statement' which is a bad suggestion.
So for a work around I wrote a Co
View Complete Post