首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ViewState问题

ViewState问题
EN

Stack Overflow用户
提问于 2011-09-09 03:52:06
回答 2查看 581关注 0票数 1

我们在Windows server2003和IIS6上使用我们的网站,也有一个带有IIS5的测试服务器2003。当我在测试服务器上用ViewState测试页面时,它工作得很好。但是我们在运行IIS6的其他服务器上进行了测试,它给出了错误。我在文件中比较了web配置,它看起来是一样的。有机器密钥和视图状态的最大长度。我已经花了几天时间了,还是找不到。有人能帮我。

这种错误并不总是发生。所以我认为源代码不是问题所在。这是我的错误

代码语言:javascript
复制
[SerializationException: Member '_name' was not found.]
   System.Runtime.Serialization.SerializationInfo.GetElement(String name, Type& foundType) +7608149
   System.Runtime.Serialization.SerializationInfo.GetString(String name) +24
   SD.LLBLGen.Pro.ORMSupportClasses.EntityBase2..ctor(SerializationInfo info, StreamingContext context) +69
   PV.Data.Standard.EntityClasses.ClinicEntity..ctor(SerializationInfo info, StreamingContext context) +26

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle._SerializationInvoke(Object target, SignatureStruct& declaringTypeSig, SerializationInfo info, StreamingContext context) +0
   System.Reflection.RuntimeConstructorInfo.SerializationInvoke(Object target, SerializationInfo info, StreamingContext context) +108
   System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context) +273
   System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder) +49
   System.Runtime.Serialization.ObjectManager.DoFixups() +223
   System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) +188
   System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) +203
   System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream) +12
   System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +968
   System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +291
   System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +392
   System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +404
   System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +392
   System.Web.UI.ObjectStateFormatter.Deserialize(Stream inputStream) +135

[ArgumentException: The serialized data is invalid.]
   System.Web.UI.ObjectStateFormatter.Deserialize(Stream inputStream) +199
   System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +297
   System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) +4
   System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) +37
   System.Web.UI.HiddenFieldPageStatePersister.Load() +113

[ViewStateException: Invalid viewstate. 
    Client IP: 10.0.51.92
    Port: 51267
    User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; BRI/1)
    ViewState: /wEPDwUJODUyMDU5NzIxDxYOHgpQcmFjdGljZVBrKClYU3lzdGVtLkd1aWQsIG1zY29ybGliLCBWZXJzaW9uPTIuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49Yjc3YTVjNTYxOTM0ZTA4OSRlMzE4OTAzNy0xOWY3LWRmMTEtOGQwNC0wMDFlMGI2ZTE4MWEeCENsaW5pY1BrKCsEJGQyYzg3OWI4LTE5ZjctZGYxMS04ZDA0LTAwMWUwYjZlMTgxYR4IUHJhY3RpY2UFBFBDTFAeBkNsaW5pYwUKVy4gUk9CSU5TTx4M..]

[HttpException (0x80004005): The state information is invalid for this page and might be corrupted.]
   System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +106
   System.Web.UI.ViewStateException.ThrowViewStateError(Exception inner, String persistedState) +14
   System.Web.UI.HiddenFieldPageStatePersister.Load() +217
   System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +105
   System.Web.UI.Page.LoadAllState() +43
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242
   System.Web.UI.Page.ProcessRequest() +80
   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
   System.Web.UI.Page.ProcessRequest(HttpContext context) +49
   ASP.clinicinfo_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\9ca5f508\2be4cd8e\App_Web_sqt6xlmv.2.cs:0
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
EN

回答 2

Stack Overflow用户

发布于 2011-09-09 04:10:31

我想,如果你的测试服务器运行在你的生产服务器所使用的相同版本的windows和IIS上,那么你的测试服务器可能会更好地发挥它的作用,这一点太明显了。(所以这实际上是一个建议……)

否则,在不深入所有可能导致此问题的问题的情况下,您可以在IIS6中使用IIS5兼容模式。

在IIS中单击网站上的R- Manager

  • Service

  • check-mark IIS5

复选框

票数 0
EN

Stack Overflow用户

发布于 2011-09-09 04:21:19

SD.LLBLGen.Pro.ORMSupportClasses.EntityBase2类曾经有过一个名为_name的成员吗?这里涉及到负载均衡吗?

看起来ViewState是在一台机器上创建的,在该机器上SD.LLBLGen.Pro.ORMSupportClasses.EntityBase2类有一个_name_ member, and then the ViewState is being interpreted on a machine where that class does not have a_name`成员。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7353659

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档