Asp.Net webforms Viewstate validation getting failed - asp.net

I have a website hosted on shared server, running on .Net version : 4.0.30319.34280
I was initially getting the following error
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.
In order to fix it I added a section in my web.config, by following the steps mentioned at : https://support.microsoft.com/en-us/kb/312906
Now I am getting the following error
Unable to validate data.
stack trace:
[HttpException (0x80004005): Unable to validate data.]
System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Boolean useValidationSymAlgo, Boolean useLegacyMode, IVType ivType, Boolean signData) +1072
System.Web.UI.Page.EncryptString(String s, Purpose purpose) +150
System.Web.Handlers.AssemblyResourceLoader.FormatWebResourceUrl(String assemblyName, String resourceName, Int64 assemblyDate, Boolean htmlEncoded) +52
System.Web.Handlers.AssemblyResourceLoader.GetWebResourceUrlInternal(Assembly assembly, String resourceName, Boolean htmlEncoded, Boolean forSubstitution, IScriptManager scriptManager, Boolean enableCdn) +662
System.Web.Handlers.AssemblyResourceLoader.GetWebResourceUrl(Type type, String resourceName, Boolean htmlEncoded, IScriptManager scriptManager, Boolean enableCdn) +188
System.Web.UI.ClientScriptManager.GetWebResourceUrl(Page owner, Type type, String resourceName, Boolean htmlEncoded, IScriptManager scriptManager, Boolean enableCdn) +99
System.Web.UI.ClientScriptManager.RegisterClientScriptResource(Type type, String resourceName) +96
System.Web.UI.WebControls.BaseValidator.RegisterValidatorCommonScript() +212
System.Web.UI.WebControls.BaseValidator.OnPreRender(EventArgs e) +85
System.Web.UI.Control.PreRenderRecursiveInternal() +88
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Control.PreRenderRecursiveInternal() +160
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +883
Any help in solving would be appreciated.

It could be that IIS recycled your app and therefore you get new keys for the session/view state. To alleviate this, add a machine static key in the web.config.
<machineKey
validationKey="56AB7132992003EE87F74AE4D9675D65EED8018D3528C0B8874905B51940DEAF6B85F1D922D19AB8F69781B2326A2F978A064708822FD8C54ED74CADF8592E17"
decryptionKey="A69D80B92A16DFE1698DFE86D4CED630FA56D7C1661C8D05744449889B88E8DC"
validation="SHA1" decryption="AES" />
Refrence Link

Related

Parsing property in ASP version 4 causes FormatException

I have this code fragment
public Version BuildVersion =Version.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["BuildVersion"].ToString());
which reads following appSetting entry
<appSettings>
<add key="BuildVersion" value="4.7.2.2" />
</appSettings>
This throws exception
[FormatException: Input string was not in a correct format.]
System.VersionResult.SetFailure(ParseFailureKind failure, String argument) +10852983
System.Version.TryParseComponent(String component, String componentName, VersionResult& result, Int32& parsedComponent) +105
System.Version.TryParseVersion(String version, VersionResult& result) +135
System.Version.Parse(String input) +68
QuickPick.Main..ctor() in D:\IWROX-DEV\Expresslane\IWorx-Trunk-PromoFrontEnd\ExpressLane.Web\Main.Master.cs:52
ASP.main_master..ctor() in c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\e43b3107\2f748eb6\App_Web_main.master.cdcab7d2.uaxqveln.0.cs:0
__ASP.FastObjectFactory_app_web_main_master_cdcab7d2_uaxqveln.Create_ASP_main_master() in c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\e43b3107\2f748eb6\App_Web_main.master.cdcab7d2.uaxqveln.1.cs:0
System.Web.Compilation.BuildResultCompiledType.CreateInstance() +30
System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection) +782
System.Web.UI.Page.get_Master() +54
System.Web.UI.Page.ApplyMasterPage() +14
System.Web.UI.Page.PerformPreInit() +45
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +335
once deployed to the server, However it runs fine on VS2010 web host (ASP NET Development Server).
Most likely the correct config file is not deployed to your host.

Getting an error serving images from App_Themes when using precompilation?

I have an ASP.NET site with both WebForms and MVC sections to it. When I try to precompile the site, everything works except serving images/css from under App_Themes.
If I request something like /foo/App_Themes/themeName/my.png, I get this error:
The file '/foo/App_Themes/themeName/my.png.cshtml' is in the special directory 'App_Themes', which is not allowed.
I only get this when precompiling, it works fine otherwise. Presumably MVC routing is interfering somehow, but I don't know why or how to disable it.
In case it's helpful, here's the stack trace:
System.Web.Compilation.BuildManager.ValidateVirtualPathInternal(VirtualPath virtualPath, Boolean allowCrossApp, Boolean codeFile) +9930801
System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +455
System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +103
System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) +165
System.Web.Compilation.BuildManager.GetObjectFactory(String virtualPath, Boolean throwIfNotFound) +33
System.Web.WebPages.BuildManagerWrapper.GetObjectFactory(String virtualPath) +26
System.Web.WebPages.BuildManagerWrapper.ExistsInPrecompiledSite(String virtualPath) +80
System.Web.WebPages.BuildManagerWrapper.Exists(String virtualPath) +13
System.Web.WebPages.<>c__DisplayClass1.<Exists>b__0(IVirtualPathFactory factory) +15
System.Linq.Enumerable.Any(IEnumerable`1 source, Func`2 predicate) +146
System.Web.WebPages.VirtualPathFactoryManager.Exists(String virtualPath) +73
System.Web.WebPages.DefaultDisplayMode.GetDisplayInfo(HttpContextBase httpContext, String vir tualPath, Func`2 virtualPathExists) +42
System.Web.WebPages.<>c__DisplayClassb.<GetDisplayInfoForVirtualPath>b__8(IDisplayMode mode) +22
System.Linq.WhereSelectListIterator`2.MoveNext() +104
System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source, Func`2 predicate) +94
System.Web.WebPages.DisplayModeProvider.GetDisplayInfoForVirtualPath(String virtualPath, HttpContextBase httpContext, Func`2 virtualPathExists, IDisplayMode currentDisplayMode, Boolean requireConsistentDisplayMode) +204
System.Web.WebPages.WebPageRoute.GetRouteLevelMatch(String pathValue, IEnumerable`1 supportedExtensions, IVirtualPathFactory virtualPathFactory, HttpContextBase context, DisplayModeProvider displayModeProvider) +201
System.Web.WebPages.WebPageRoute.MatchRequest(String pathValue, IEnumerable`1 supportedExtensions, IVirtualPathFactory virtualPathFactory, HttpContextBase context, DisplayModeProvider displayModes) +281
System.Web.WebPages.WebPageRoute.DoPostResolveRequestCache(HttpContextBase context) +235
System.Web.WebPages.WebPageHttpModule.OnApplicationPostResolveRequestCache(Object sender, EventArgs e) +89
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +136
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69
I was having the same issue but it only occured when I published my web application and would work fine locally. I came up with two potential solutions.
Hacky solution
By looking at the source code I could see it was throwing this error as the "BuildManager" object had a field "_forbiddenTopLevelDirectories" which it would check and throw an expection if the path was in a number of special directories, "App_Themes" being one of them.
So by using reflection I remove the "App_Themes" object from the collection by calling the following code in the global file Application_Start method.
var buildManagerType = typeof(BuildManager);
var theBuilderManager = buildManagerType.GetField("_theBuildManager"
, BindingFlags.Static | BindingFlags.NonPublic)
.GetValue(null);
var forbiddenDirectoryField = buildManagerType
.GetField("_forbiddenTopLevelDirectories",
BindingFlags.Instance | BindingFlags.NonPublic)
.GetValue(theBuilderManager);
var removeMethod = forbiddenDirectoryField.GetType().GetMethod("Remove");
removeMethod.Invoke(forbiddenDirectoryField, new object[] { "App_Themes" });
This solved the issue and my css + image files would now be correctly served when deployed. Warning - I do not have a good understanding of the consequences of editing the _forbiddenTopLevelDirectories field and doing this may have unintended side effects.
Alternative solution
Another thing i noticed was I would not recieve the errors when the runAllManagedModulesForAllRequests attribute of the modules node in the webconfig was set to false. So if your application can work with this set to false consider this solution
<modules runAllManagedModulesForAllRequests="false">

How to stop asp.net from trying to load sharepoint?

I have a ASP.net forms page that is acting as a proxy.
My website is downloading some content from another website, companyX.com.
companyX.com's site is using sharePoint.
My site is downloading the HTML from companyX.com and successfully adding it to my page, however, after Page_Init, Page_Load and Page_Unload but before Render my page is throwing the error pasted below.
My site does not have any sharepoint installed. However, it looks like there is something in asp.net that is processing the HTML content in my page, recognizing some sharepoint tags and then trying to load sharepoint. I would love to turn this off!
My page does have EnableViewState="false" EnableViewStateMac="false" ValidateRequest="false"
Error:
System.Web.HttpException (0x80004005): The state information is invalid for this page and might be corrupted. ---> System.Web.UI.ViewStateException: Invalid viewstate.
Client IP: 127.0.0.1
Port: 55413
Referer: xxx/App.aspx?id=xxx
Path: /App.aspx
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36
ViewState: xxx... ---> System.ArgumentException: The serialized data is invalid. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.Type.GetType(String typeName, Boolean throwOnError)
at System.Web.UI.ObjectStateFormatter.DeserializeType(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader)
at System.Web.UI.ObjectStateFormatter.Deserialize(Stream inputStream)
--- End of inner exception stack trace ---
at System.Web.UI.ObjectStateFormatter.Deserialize(Stream inputStream)
at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString, Purpose purpose)
at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter2.Deserialize(String serializedState, Purpose purpose)
at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter2 formatter, String serializedState, Purpose purpose)
at System.Web.UI.HiddenFieldPageStatePersister.Load()
--- End of inner exception stack trace ---
at System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError)
at System.Web.UI.HiddenFieldPageStatePersister.Load()
at System.Web.UI.Page.LoadPageStateFromPersistenceMedium()
at System.Web.UI.Page.LoadAllState()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.app_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
ASP.net isn't tying to load Sharepoint, it's trying to make sense of the ViewState contained in the page you are retrieving but cannot because it is built by another server with a different machine key et al.
I would personally remove the ViewState hidden field from the retrieved HTML prior to the Render stage, otherwise you might have ongoing issues that may confuse matters on a random basis.
I finally finally fixed it by adding the following to my page:
Protected Overrides Function LoadPageStateFromPersistenceMedium() As Object
Return Nothing
End Function

Model First Entity Framework connection string error "Initialization string begin with 0 "

I'm building an ASP.NET web app with an Entity Framework model first DAL.
I've two VS project:
a class library with the designed model
an ASP.NET Web Application.
In the class library EF generated for me the folowing connection string:
<add name="DatabaseModelContainer" connectionString="metadata=res://*/DAL.DatabaseModel.csdl|res://*/DAL.DatabaseModel.ssdl|res://*/DAL.DatabaseModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=NBK179\SQLEXPRESS;Initial Catalog=TaskBoardTest;Integrated Security=True;MultipleActiveResultSets=True""providerName="System.Data.EntityClient" />
It works in the class library project but when i paste it in the web app and try to use it with a EntityDataSource a get this error:
[ArgumentException: Formato della stringa di inizializzazione non conforme alla specifica che inizia all'indice 0.]
System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue) +5081160
System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +132
System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +98
System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString) +118
System.Data.EntityClient.EntityConnection..ctor(String connectionString) +81
System.Data.Objects.ObjectContext.CreateEntityConnection(String connectionString) +42
System.Data.Objects.ObjectContext..ctor(String connectionString) +12
System.Web.UI.WebControls.EntityDataSourceView.ConstructContext() +467
System.Web.UI.WebControls.EntityDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +76
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +21
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +143
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74
System.Web.UI.WebControls.GridView.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +66
System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +75
System.Web.UI.Control.EnsureChildControls() +102
System.Web.UI.Control.PreRenderRecursiveInternal() +42
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496
My code:
Asp.net Page:
<asp:EntityDataSource runat="server"
ID="applicationDataSource"
ConnectionString="DatabaseModelContainer"
DefaultContainerName="DatabaseModelContainer"
EnableFlattening="true" ></asp:EntityDataSource>
Web.config
<add name="DatabaseModelContainer" connectionString="metadata=res://*/DAL.DatabaseModel.csdl|res://*/DAL.DatabaseModel.ssdl|res://*/DAL.DatabaseModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=NBK179\SQLEXPRESS;Initial Catalog=TaskBoardTest;Integrated Security=True;MultipleActiveResultSets=True""providerName="System.Data.EntityClient" />
How can I solve this problem? Thanks in advance.

ViewState issue

We are using our website on Windows server 2003 with IIS 6 and also have a test server 2003 with IIS 5.
When I tested the page with ViewState on test server, it worked fine. But we tested on other server which is running IIS 6.It gave error. I compared web configuratioin file, it looked the same. There was the machine key and maximum length for view state. I've been spending couple days and still don't find it. Somebody can help me.
This error doesn't happen all the time. So I think the source code is not the problem.
Here is my error
[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
I guess it's too obvious to say that your test server might serve it's purpose better if it ran on the same version of windows and IIS that your production server uses... (so that's actually one suggestion...)
Otherwise, without digging into all of the possible issues that could be causing this, you can use IIS5 compatibility mode in IIS6.
R-click your website in IIS Manager
Service
check-mark the IIS 5 Isolation mode checkbox
Has the SD.LLBLGen.Pro.ORMSupportClasses.EntityBase2 class ever had a member named _name? Is there load balancing involved here?
It looks like the ViewState was created on a machine where the SD.LLBLGen.Pro.ORMSupportClasses.EntityBase2 class had a _name_ member, and then the ViewState is being interpreted on a machine where that class does not have a_name` member.

Resources