I have a project running on my local machine and everything works fine. When I move the project to the production environment I get the following error:
The ObjectContext instance has been disposed and can no longer be used for operations that require a connection.
Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ObjectDisposedException: The ObjectContext instance has been disposed and can no longer be used for operations that require a connection.
Source Error:
Line 4382: get
Line 4383: {
Line 4384: return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ContentType>("PortediloModel.FK_Content_ContentType", "ContentType").Value; Line 4385: }
Line 4386: set
Someone had this problem before and know waht's wrong?
mattialocate...
Member
38 Points
30 Posts
The ObjectContext instance has been disposed error
Feb 29, 2012 07:32 AM|LINK
Hello everybody,
I have a project running on my local machine and everything works fine. When I move the project to the production environment I get the following error:
The ObjectContext instance has been disposed and can no longer be used for operations that require a connection.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ObjectDisposedException: The ObjectContext instance has been disposed and can no longer be used for operations that require a connection.
Source Error:
Line 4382: get Line 4383: { Line 4384: return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<ContentType>("PortediloModel.FK_Content_ContentType", "ContentType").Value; Line 4385: } Line 4386: setSomeone had this problem before and know waht's wrong?
Thanks,
Mattia
mameenkhn
Contributor
2026 Points
391 Posts
Re: The ObjectContext instance has been disposed error
Feb 29, 2012 07:40 AM|LINK
Did you check the web.config connectionstring
--------------------------------------------------
Muhammad Amin
محمد امين
Dino He - MS...
Star
8068 Points
1023 Posts
Microsoft
Re: The ObjectContext instance has been disposed error
Mar 02, 2012 01:49 AM|LINK
Hi
Same discussion here:
http://forums.asp.net/t/1685186.aspx/1/10
Hope it helpful.
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework
kattyjems
Member
120 Points
50 Posts
Re: The ObjectContext instance has been disposed error
Mar 07, 2012 07:39 AM|LINK
Hi,
Could you please provide a bit long code?
I can't view full code because it could not be wrapped.