System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded() +2725318 - asp.net

i am getting an error while page reload on a dropdownlist option chang
[InvalidOperationException: Operation is not valid due to the current state of the object.]
System.Web.HttpValueCollection.ThrowIfMaxHttpCollectionKeysExceeded() +2725318
System.Web.HttpValueCollection.FillFromEncodedBytes(Byte[] bytes, Encoding encoding) +61
System.Web.HttpRequest.FillInFormCollection() +148
[HttpException (0x80004005): The URL-encoded form data is not valid.]
System.Web.HttpRequest.FillInFormCollection() +206
System.Web.HttpRequest.get_Form() +68
System.Web.HttpRequest.get_HasForm() +8807191
System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) +97
System.Web.UI.Page.DeterminePostBackMode() +63
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +133
I had found some articles saying if you increase the value of MaxHttpCollectionKeys in the app setting it will work but it doesn't seem to work for me
I have tried various different values extending to the below value but none work of
<add key="aspnet:MaxHttpCollectionKeys" value="900000000000000000000000000000" />
you help is most appreciated

Related

ASP.Net on actual site yields security exception

I deleted and recreated the subdomain for an ASP.Net site. I then uploaded the files, but when I go and open a browser, I get a security exception that states that I have to modify the application's configuration file to grant trust. Sadly, the error message does not say the file that caused the issue, the trust that is a problem, or anything that I can see.
Here is what I see:
Server Error in '/' Application.
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Source Error:
[No relevant source lines]
Source File: App_Web_iqeawexe.0.cs Line: 0
Stack Trace:
[SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark) +31
System.Security.CodeAccessPermission.Demand() +46
System.Reflection.RuntimeAssembly.VerifyCodeBaseDiscovery(String codeBase) +118
System.Reflection.RuntimeAssembly.GetName(Boolean copiedName) +69
System.Reflection.Assembly.GetName() +12
DevExpress.Web.ASPxClasses.Internal.HttpUtils.<get_DXValidatorType>b__0(Assembly i) +9
System.Linq.WhereArrayIterator`1.MoveNext() +55
System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source) +4216052
DevExpress.Web.ASPxClasses.Internal.HttpUtils.get_DXValidatorType() +120
DevExpress.Web.ASPxClasses.Internal.HttpUtils.GetValueFromRequest(HttpRequest request, String key, Boolean skipValidation) +25
DevExpress.Web.ASPxClasses.Internal.HttpUtils.GetValueFromRequest(String key, Boolean skipValidation) +60
DevExpress.Web.ASPxClasses.Internal.MvcUtils.get_CallbackName() +79
DevExpress.Web.ASPxClasses.Internal.RenderUtils.IsAnyCallback(Page page) +51
DevExpress.Web.ASPxClasses.Internal.ResourceRegistrator.EnsureResourcesSynchronized(Page page) +55
DevExpress.Web.ASPxClasses.Internal.ResourceRegistrator.RegisterResource(Page page, ResourceData resource, Boolean useStandardRegistration) +19
DevExpress.Web.ASPxClasses.ASPxWebControl.RegisterHoverIncludeScripts() +84
DevExpress.Web.ASPxClasses.ASPxWebControl.RegisterClientIncludeScripts() +72
DevExpress.Web.ASPxClasses.ASPxWebControl.OnPreRender(EventArgs e) +96
DevExpress.Web.ASPxClasses.ASPxDataWebControlBase.OnPreRender(EventArgs e) +32
System.Web.UI.Control.PreRenderRecursiveInternal() +103
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +8431
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +253
System.Web.UI.Page.ProcessRequest() +78
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.default_aspx.ProcessRequest(HttpContext context) in App_Web_iqeawexe.0.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +100
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
Thoughts?
The problem turned out to be an defect in DevExpress release. The release posted on July 8th broke websites using Medium Trust model. They posted a hotfix.
Here is what DevExpress wrote me: "We have already fixed this issue in the context of the System.Security.Permissions.FileIOPermission exception after updating to DevExpress 2013.1.5 in Medium Trust environment ticket. I suggest that you download a fix and check whether or not the problem persists."
I was not expecting a big company to not do thorough testing, which is what made this bug hard to track down.

CRM 2011 Trace error on saving Order - The entity with a name = 'new_customtestingentity' was not found in the MetadataCache

This is a puzzle!
When I convert CRM 2011 quotes to orders I can save the order record and use it as normal. However when I attempt to create a new Order when I click the Save button I get a dialog with 'A error occurred' and the record fails to save. The CRM trace is below but I can fathom what the problem is - I've never even created a entity called 'new_customtestingentity'
Things I've tried:-
a) Renaming the statuscode fields to their original names (I had changed them previously)
b) Disabling the onsave javascript event in the form
c) Re-enabling the default ribbon menu (I had hidden some unused bussons previously)
Trace:
Crm Exception: Message: The entity with a name = 'new_customtestingentity' was not found in the MetadataCache., ErrorCode: -2147217150
[2013-06-17 10:09:36.345] Process: w3wp |Organization:d8e7913e-0f93-45b7-ad9d-6a48d10b0de3 |Thread: 33 |Category: Application |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: 5cb5f3d1-1f7d-437f-828e-94676987a567 | ErrorInformation.LogError ilOffset = 0x17
>MSCRM Error Report:
Error: Exception of type 'System.Web.HttpUnhandledException' was thrown.
Error Message: 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.
Error Details: Exception of type 'System.Web.HttpUnhandledException' was thrown.
Source File: Not available
Line Number: Not available
Stack Trace Info: [ArgumentException: Invalid state for this entity: salesorder: 0
Parameter name: state]
at Microsoft.Crm.Application.Platform.EntityProxy.ConvertStateToNumber(String entityName, String state)
at Microsoft.Crm.Application.Platform.AttributeCollection.CreateOptionSetValueFromValue(String name, Object value, AttributeType attributeType, String entityLogicalName)
at Microsoft.Crm.Application.Platform.AttributeCollection.SetEntityProperty(Entity entity, String name, String childAttributeName, Object parentProperty, AttributeMetadata attributeMetadata, Object value, IOrganizationContext context)
at Microsoft.Crm.Application.Platform.AttributeCollection.Insert(String name, Object value, Boolean throwIfKeyExists)
at Microsoft.Crm.Application.Platform.EntityProxy.SetData(XmlNode entityElement)
at Microsoft.Crm.Application.Forms.EndUserForm.RetrieveParametersForEventDefault()
at Microsoft.Crm.Application.Forms.EndUserForm.Initialize(Entity entity)
at Microsoft.Crm.Application.Forms.CustomizableForm.Execute(Entity entity, FormDescriptor fd)
at Microsoft.Crm.Application.Components.PageHandlers.SalesorderRecordPageHandler.ConfigureFormHandler()
at Microsoft.Crm.Application.Components.PageHandlers.RecordPageHandler.ConfigureFormWrapper()
at Microsoft.Crm.Application.Components.Utility.GenericEventProcessor.RaiseEvent(String eventName)
at Microsoft.Crm.Application.Controls.PageManager.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
[HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown.]
at System.Web.UI.Page.HandleError(Exception e)
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.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
[2013-06-17 10:09:36.345] Process: w3wp |Organization:00000000-0000-0000-0000-000000000000 |Thread: 33 |Category: Platform |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: 5cb5f3d1-1f7d-437f-828e-94676987a567 | ExceptionConverter.ConvertToFault ilOffset = 0x57
UNEXPECTED: no fault?
[2013-06-17 10:09:36.345] Process: w3wp |Organization:00000000-0000-0000-0000-000000000000 |Thread: 33 |Category: Platform |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: 5cb5f3d1-1f7d-437f-828e-94676987a567 | ExceptionConverter.ConvertMessageAndErrorCode ilOffset = 0x23B
System.Web.HttpUnhandledException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #5F67091F: System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.ArgumentException: Invalid state for this entity: salesorder: 0
Parameter name: state
at Microsoft.Crm.Application.Platform.EntityProxy.ConvertStateToNumber(String entityName, String state)
at Microsoft.Crm.Application.Platform.AttributeCollection.CreateOptionSetValueFromValue(String name, Object value, AttributeType attributeType, String entityLogicalName)
at Microsoft.Crm.Application.Platform.AttributeCollection.SetEntityProperty(Entity entity, String name, String childAttributeName, Object parentProperty, AttributeMetadata attributeMetadata, Object value, IOrganizationContext context)
at Microsoft.Crm.Application.Platform.AttributeCollection.Insert(String name, Object value, Boolean throwIfKeyExists)
at Microsoft.Crm.Application.Platform.EntityProxy.SetData(XmlNode entityElement)
at Microsoft.Crm.Application.Forms.EndUserForm.RetrieveParametersForEventDefault()
at Microsoft.Crm.Application.Forms.EndUserForm.Initialize(Entity entity)
at Microsoft.Crm.Application.Forms.CustomizableForm.Execute(Entity entity, FormDescriptor fd)
at Microsoft.Crm.Application.Components.PageHandlers.SalesorderRecordPageHandler.ConfigureFormHandler()
at Microsoft.Crm.Application.Components.PageHandlers.RecordPageHandler.ConfigureFormWrapper()
at Microsoft.Crm.Application.Components.Utility.GenericEventProcessor.RaiseEvent(String eventName)
at Microsoft.Crm.Application.Controls.PageManager.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.HandleError(Exception e)
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.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
[2013-06-17 10:09:36.345] Process: w3wp |Organization:00000000-0000-0000-0000-000000000000 |Thread: 33 |Category: Platform |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: 5cb5f3d1-1f7d-437f-828e-94676987a567 | ExceptionConverter.ConvertToFault ilOffset = 0x69
UNEXPECTED: no fault?
Solved!
When debugging some status options I had added the field status to the CRM main form. Somehow this caused everything to fall over on saving.
After removing the field (it still appears in the footer as per default) it saves without problem.

How can resolve Error: "Could not load type 'Microsoft.SharePoint.WebControls.SPGridView" SharePoint 2010?

Following error comes when creating a WebPart In sharePoint 2010 Server.
Web Part Error: Unhandled exception was thrown by the user code wrapper's Execute method in the partial trust app domain: System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.TypeLoadException: Could not load type 'Microsoft.SharePoint.WebControls.SPGridView' from assembly 'Microsoft.SharePoint, Version=14.900.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'. at ListMenuSample.ListMenuSample.ListMenuSample.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace --- at System.Web.UI.Page.HandleError(Exception e) 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.ProcessRequest(HttpContext context) at Microsoft.SharePoint.UserCode.SPUserCodeWebPartWrapper.ExecuteHttpRequest(SPUserCodeWebPartHttpRequestContext webPartExecutionContext, SPUserCodeWebPartHttpResponse httpRequestResponse) at Microsoft.SharePoint.UserCode.SPUserCodeWebPartWrapper.Execute(SPUserCodeExecutionContext executionContext) at Microsoft.SharePoint.UserCode.SPUserCodeApplicationHostAppDomainRef.Execute(Type userCodeWrapperType, SPUserCodeCachedAssemblyGroup userAssemblyGroup, Guid siteCollectionId, Byte[] binaryUserCodeToken, Byte[] proxyOperationToken, SPUserCodeExecutionContext executionContext)
When you look at the SharePoint 2010 server, what is the version number of the Microsoft.Sharepoint DLL in the GAC (windows\assembly)? If somehow your code is specifically tied to version 14.900.00 and the version in the assembly is different then that may be your problem.
Also, just wanted to double check that you aren't deploying a copy of the Microsoft.SharePoint DLL with your solution, because that would be bad.

System.Drawing: GDI+ is not properly initialized (​internal GDI+ error​)

An ASP.NET Web Site raises randomly this System.Drawing-error:
System.Runtime.InteropServices.ExternalException: System.Drawing.Bitmap..ctor(Stream stream)
System.Drawing.ToolboxBitmapAttribute..cctor()
Exception information:
Exception type: TypeInitializationException
Exception message: The type initializer for 'System.Drawing.ToolboxBitmapAttribute' threw an exception.
Stack trace: at System.Reflection.CustomAttribute._CreateCaObject(Void* pModule, Void* pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
at System.Reflection.CustomAttribute.CreateCaObject(Module module, RuntimeMethodHandle ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
at System.Reflection.CustomAttribute.GetCustomAttributes(Module decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
at System.RuntimeType.GetCustomAttributes(Type attributeType, Boolean inherit)
at System.ComponentModel.ReflectTypeDescriptionProvider.ReflectGetAttributes(Type type)
at System.ComponentModel.ReflectTypeDescriptionProvider.ReflectedTypeData.GetAttributes()
at System.ComponentModel.TypeDescriptor.TypeDescriptionNode.DefaultTypeDescriptor.System.ComponentModel.ICustomTypeDescriptor.GetAttributes()
at System.ComponentModel.TypeDescriptor.GetAttributes(Type componentType)
at System.Web.UI.ThemeableAttribute.IsTypeThemeable(Type type)
at System.Web.UI.Control.ApplySkin(Page page)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Why? I think that this is a .NET Framework error (I'm actually not trying to create any images).
I found a temporary solution: restart IIS and delete Temporary ASP.NET Files ("%WINDIR%\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files").
But when this error happens in the production web-server, temporary is not enough...
By coincidence we've had this on one of our servers today. It's a known issue in ASP.NET, there's a hotfix for it at http://support.microsoft.com/kb/975410.
Changing this setting to true in the web.config fixed it for me:
<validation validateIntegratedModeConfiguration="true" />

paging count error asp.net

I have a data list with paging which works fine locally debugging but doesn't work on my deployment server provided by my hosting company.
Line 151: TotalRowCount = pagedData.DataSourceCount;
I'm using the same remote database for both local and on deployment server.
Error message:
Server Error in '/' Application.
Object reference not set to an instance of an object.
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.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 149:
Line 150: // Remember the total number of records being paged through across postbacks
Line 151: TotalRowCount = pagedData.DataSourceCount;
Line 152: PrevPage.Visible = !pagedData.IsFirstPage;
Line 153: NextPage.Visible = !pagedData.IsLastPage;
Source File: \\pdc1\sites\t\test.domain.com\public_html\Auctions.aspx.cs Line: 151
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Auctions.ItemDataSource_Selected(Object sender, ObjectDataSourceStatusEventArgs e) in \\pdc1\sites\t\test.domain.com\public_html\Auctions.aspx.cs:151
System.Web.UI.WebControls.ObjectDataSourceView.OnSelected(ObjectDataSourceStatusEventArgs e) +95
System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance) +432
System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1247
System.Web.UI.WebControls.BaseDataList.GetData() +38
System.Web.UI.WebControls.DataList.CreateControlHierarchy(Boolean useDataSource) +153
System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e) +54
System.Web.UI.WebControls.BaseDataList.DataBind() +55
System.Web.UI.WebControls.BaseDataList.EnsureDataBound() +60
System.Web.UI.WebControls.BaseDataList.CreateChildControls() +69
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +44
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
This implies the connection to your database from the server isn't working, as the pagedData object is null.
Check you can access your datasource, with the correct identity.

Resources