c# - MVC Session Serialization Error.Unable to find assembly 'EntityFrameworkDynamicProxies -


i have mvc commerce project. use sessions user login. example use membership information in session this.ofc session not null.

member member=session["membersuccess"] member 

also because of pool time of shared hostings use sql state session.it works fine @ localhost. when upload server gives me error this;

unable find assembly 'entityframeworkdynamicproxies-datalayer, version=1.0.0.0, culture=neutral, publickeytoken=null'. 

i don't know there relevance servers trust level full. use entity framework. , keep edmx file in seperate class library. tried adding [serializable] attiributes @ classes under .tt file.

and here stack trace

[serializationexception: unable find assembly 'entityframeworkdynamicproxies-datalayer, version=1.0.0.0, culture=neutral, publickeytoken=null'.]    system.runtime.serialization.formatters.binary.binaryassemblyinfo.getassembly() +3124514    system.runtime.serialization.formatters.binary.objectreader.gettype(binaryassemblyinfo assemblyinfo, string name) +10830282    system.runtime.serialization.formatters.binary.objectmap..ctor(string objectname, string[] membernames, binarytypeenum[] binarytypeenuma, object[] typeinformationa, int32[] memberassemids, objectreader objectreader, int32 objectid, binaryassemblyinfo assemblyinfo, sizedarray assemidtoassemblytable) +120    system.runtime.serialization.formatters.binary.__binaryparser.readobjectwithmaptyped(binaryobjectwithmaptyped record) +286    system.runtime.serialization.formatters.binary.__binaryparser.readobjectwithmaptyped(binaryheaderenum binaryheaderenum) +57    system.runtime.serialization.formatters.binary.__binaryparser.run() +581    system.runtime.serialization.formatters.binary.objectreader.deserialize(headerhandler handler, __binaryparser serparser, boolean fcheck, boolean iscrossappdomain, imethodcallmessage methodcallmessage) +120    system.runtime.serialization.formatters.binary.binaryformatter.deserialize(stream serializationstream, headerhandler handler, boolean fcheck, boolean iscrossappdomain, imethodcallmessage methodcallmessage) +186    system.web.util.altserialization.readvaluefromstream(binaryreader reader) +937    system.web.sessionstate.sessionstateitemcollection.readvaluefromstreamwithassert() +55    system.web.sessionstate.sessionstateitemcollection.deserializeitem(string name, boolean check) +289    system.web.sessionstate.sessionstateitemcollection.get_item(string name) +19    system.web.sessionstate.httpsessionstatecontainer.get_item(string name) +11    system.web.httpsessionstatewrapper.get_item(string name) +14    asp._page_views_shared__layout_cshtml.execute() +186    system.web.webpages.webpagebase.executepagehierarchy() +198    system.web.mvc.webviewpage.executepagehierarchy() +104    system.web.webpages.webpagebase.executepagehierarchy(webpagecontext pagecontext, textwriter writer, webpagerenderingbase startpage) +90    system.web.webpages.<>c__displayclass7.<renderpagecore>b__6(textwriter writer) +230    system.web.webpages.helperresult.writeto(textwriter writer) +10    system.web.webpages.webpagebase.write(helperresult result) +80    system.web.webpages.webpagebase.rendersurrounding(string partialviewname, action`1 body) +64    system.web.webpages.webpagebase.popcontext() +262    system.web.webpages.webpagebase.executepagehierarchy(webpagecontext pagecontext, textwriter writer, webpagerenderingbase startpage) +98    system.web.mvc.razorview.renderview(viewcontext viewcontext, textwriter writer, object instance) +255    system.web.mvc.buildmanagercompiledview.render(viewcontext viewcontext, textwriter writer) +107    system.web.mvc.viewresultbase.executeresult(controllercontext context) +291    system.web.mvc.controlleractioninvoker.invokeactionresult(controllercontext controllercontext, actionresult actionresult) +13    system.web.mvc.<>c__displayclass1a.<invokeactionresultwithfilters>b__17() +23    system.web.mvc.controlleractioninvoker.invokeactionresultfilter(iresultfilter filter, resultexecutingcontext precontext, func`1 continuation) +245    system.web.mvc.<>c__displayclass1c.<invokeactionresultwithfilters>b__19() +22    system.web.mvc.controlleractioninvoker.invokeactionresultwithfilters(controllercontext controllercontext, ilist`1 filters, actionresult actionresult) +176    system.web.mvc.async.<>c__displayclass2a.<begininvokeaction>b__20() +75    system.web.mvc.async.<>c__displayclass25.<begininvokeaction>b__22(iasyncresult asyncresult) +99    system.web.mvc.async.wrappedasyncresult`1.end() +50    system.web.mvc.async.asynccontrolleractioninvoker.endinvokeaction(iasyncresult asyncresult) +44    system.web.mvc.<>c__displayclass1d.<beginexecutecore>b__18(iasyncresult asyncresult) +14    system.web.mvc.async.<>c__displayclass4.<makevoiddelegate>b__3(iasyncresult ar) +23    system.web.mvc.async.wrappedasyncresult`1.end() +55    system.web.mvc.controller.endexecutecore(iasyncresult asyncresult) +58    system.web.mvc.async.<>c__displayclass4.<makevoiddelegate>b__3(iasyncresult ar) +23    system.web.mvc.async.wrappedasyncresult`1.end() +55    system.web.mvc.controller.endexecute(iasyncresult asyncresult) +48    system.web.mvc.controller.system.web.mvc.async.iasynccontroller.endexecute(iasyncresult asyncresult) +10    system.web.mvc.<>c__displayclass8.<beginprocessrequest>b__3(iasyncresult asyncresult) +25    system.web.mvc.async.<>c__displayclass4.<makevoiddelegate>b__3(iasyncresult ar) +23    system.web.mvc.async.wrappedasyncresult`1.end() +55    system.web.mvc.mvchandler.endprocessrequest(iasyncresult asyncresult) +31    system.web.mvc.mvchandler.system.web.ihttpasynchandler.endprocessrequest(iasyncresult result) +9    system.web.callhandlerexecutionstep.system.web.httpapplication.iexecutionstep.execute() +9651688    system.web.httpapplication.executestep(iexecutionstep step, boolean& completedsynchronously) +155 

try disabling proxy creation in dbcontext class:

context.configuration.proxycreationenabled = false; 

Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -