From: TBoe on
We are using a simple self-developed XCOPY-like tool for copying the binaries
etc. of a WCF application directly into the physical folder of a virtual
directory on IIS. After the deployment the application randomly throws an
excetion ("The ObjectContext instance has been disposed and can no longer be
used for operations that require a connection"). I know that this is EF
related (we are using EF for data access purposes within our WCF services)
but donÄt think it has anything to do with EF.
However, the exception occurs absolutely without any pattern. Starting our
app multiple times results in the excetion sometimes but it succeeds
immediately afterwards. I even restarted the IIS windows service but the same
phenomenon still exists afterwards.
When I use the "Publish" dialog from VS2008 for the deployment everything is
fine. However, we need to do the deployment through our script as we have a
staging location between our dev and prod environments.
What do we have to to in order to make a successfull and reliable XCOPY
deployment and get rid of this strange behaviour?