Cannot delete Custom Entities and it's not about relations - dynamics-crm

I created a fresh new entity which has no additional fields or relations to anything and also without any records.
Just after i created the entity and when i try to delete it, it gives me the following error:
An error has occurred.
And in the log file which can be downloaded from the error dialog:
System.ArgumentNullException: Value cannot be null. Parameter name: collection
And when enabled tracing the error was:
Process: w3wp |Organization:0220cef0-4f09-e711-80d8-000c2950db72 |Thread: 244 |Category: Platform.Metadata |User: 00000000-0000-0000-0000-000000000000 |Level: Error |ReqId: 17d8623e-7539-48af-9652-b8550acfb76f | EntityService.Delete ilOffset = 0x1A8
>EntityService.Update caught exception: System.ArgumentNullException: Value cannot be null.
Parameter name: collection
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at Microsoft.Crm.BusinessEntities.CascadeEngine.LogRecordSetCount(Int32 count, IEnumerable`1 entityIds, Int32 parentEntityObjectTypeCode, String perfCounterName)
at Microsoft.Crm.BusinessEntities.CascadeEngine.CascadeDeleteDB(IEnumerable`1 parentEntityIds, Int32 parentEntityObjectTypeCode, ExecutionContext context)
at Microsoft.Crm.BusinessEntities.CascadeEngine.Delete(IEnumerable`1 entityIds, Int32 entityObjectTypeCode, ExecutionContext context)
at Microsoft.Crm.BusinessEntities.CascadeEngine.DeleteAll(Int32 entityObjectTypeCode, ExecutionContext context)
at Microsoft.Crm.Metadata.EntityService.Delete(Guid entityId, MetadataHelper metadataHelper, Boolean suppressSecurityCacheFlush, ExecutionContext context)
Well i don't know whats wrong. Please let me know if you know anything. Thanks.

One thing to check is if there are any dependencies, which you can do by selecting the entity in a solution and clicking Show Dependencies:

I did noticed something that this error only happens when Persian language pack is installed, but when its just CRM with no language packs everything is fine.
So at least i know what to do now and it's not something useful to be discussed further here.
Thanks.

Related

Link all in Xamarin release,failed with Autofac Assembly

When setting the Linker behaviour to "Link all" I get the following error at runtime:
Autofac.Core.DependencyResolutionException.
I've tried adding ignore assembly Autofac but without success.
Setting the Linker behavior to "Link Framework SDKs only" does work but I want to enable "Link All" if possible.
Thanks in advance.
Update :
ReflectionActivator.ActivateInstance (Autofac.IComponentContext context, System.Collections.Generic.IEnumerable`1[T] parameters)
Autofac.Core.DependencyResolutionException: No constructors on type 'Eela.Taxi.Service.RestService' can be found with the constructor finder 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder'.
No constructors on type 'Eela.Taxi.Service.RestService' can be found with the constructor finder 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder'.
An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = RestService (ReflectionActivator), Services = [Eela.Model.Xamarin.Interfaces.IRestService], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> No constructors on type 'Eela.Taxi.Service.RestService' can be found with the constructor finder 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder'. (See inner exception for details.)
1
ReflectionActivator.ActivateInstance (Autofac.IComponentContext context, System.Collections.Generic.IEnumerable`1[T] parameters)
2
InstanceLookup.Activate (System.Collections.Generic.IEnumerable`1[T] parameters)
An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = RestService (ReflectionActivator), Services = [Eela.Model.Xamarin.Interfaces.IRestService], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> No constructors on type 'Eela.Taxi.Service.RestService' can be found with the constructor finder 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder'. (See inner exception for details.)
1
InstanceLookup.Activate (System.Collections.Generic.IEnumerable`1[T] parameters)
2
InstanceLookup.Execute ()
3
ResolveOperation.GetOrCreateInstance (Autofac.Core.ISharingLifetimeScope currentOperationScope, Autofac.Core.IComponentRegistration registration, System.Collections.Generic.IEnumerable`1[T] parameters)
4
ResolveOperation.ResolveComponent (Autofac.Core.IComponentRegistration registration, System.Collections.Generic.IEnumerable`1[T] parameters)
5
ResolveOperation.Execute (Autofac.Core.IComponentRegistration registration, System.Collections.Generic.IEnumerable`1[T] parameters)
6
LifetimeScope.ResolveComponent (Autofac.Core.IComponentRegistration registration, System.Collections.Generic.IEnumerable`1[T] parameters)
7
Container.ResolveComponent (Autofac.Core.IComponentRegistration registration, System.Collections.Generic.IEnumerable`1[T] parameters)
8
ResolutionExtensions.TryResolveService (Autofac.IComponentContext context, Autofac.Core.Service service, System.Collections.Generic.IEnumerable`1[T] parameters, System.Object& instance)
9
ResolutionExtensions.ResolveService (Autofac.IComponentContext context, Autofac.Core.Service service, System.Collections.Generic.IEnumerable`1[T] parameters)
10
ResolutionExtensions.Resolve (Autofac.IComponentContext context, System.Type serviceType, System.Collections.Generic.IEnumerable`1[T] parameters)
11
ResolutionExtensions.Resolve[TService] (Autofac.IComponentContext context, System.Collections.Generic.IEnumerable`1[T] parameters)
12
ResolutionExtensions.Resolve[TService] (Autofac.IComponentContext context)
13
App+<OnStart>d__4.MoveNext ()
14
ExceptionDispatchInfo.Throw ()
15
AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state)
16
SyncContext+<>c__DisplayClass2_0.<Post>b__0 ()
17
Thread+RunnableImplementor.Run ()
18
IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this)
19
(wrapper dynamic-method) System.Object:f9684b08-49ee-4f47-8b7c-c59b675c18f3 (intptr,intptr)
So as your Stack Trace indicates. Autofac is trying to instantiate an instance of Eela.Taxi.Service.RestService. However, it seems like the Mono Linker has removed the constructor because it is never directly invoked.
So you could do a couple of things. You could:
Add your assembly to be ignored from the linker
You could add a [Preserve] attribute on your RestService to tell the Linker not to touch it
You could similar to what MvvmCross does have a LinkerPleaseInclude.cs file which describes usage of each type that get stripped out. So for every one you discover you will need to add it here.
So 1. and 2. are fairly self explanatory. You have already used 1. for autofac, just do the same for your own assembly containing RestService. However, the downside here is that nothing in this assembly will be linked, potentially leaving you with a lot more code in it than actually needed.
For 2. you simply add [Preserve] right before declaring your class. So something like:
[Preserve]
public class RestService : IRestService { }
You may also consider using it with AllMembers = true: [Preserve(AllMembers = true)] to keep member fields too.
As for the last option. You basically create a LinkerPleaseInclude.cs in your App project. You let the linker do its job. You continue adding stuff to the class until the Linker does kill your App at runtime. So a start on LinkerPleaseInclude.cs could look like:
[Preserve(AllMembers = true)]
public class LinkerPleaseInclude
{
public void Include(IRestService service)
{
service = new RestService();
}
}
This class is never invoked, but it is enough for the linker to know that the constructor of RestService should not be linked out.

How to find issue while installing Managed Package in Cloud CRM Dynamics 365?

I am facing an issue while installing my Managed package in Cloud CRM Dynamics 365. As I am not able to track the issue, it's a headache.
Let me explain the key points:
I have set customizable false for all the components
I have registered Plug-in in Sandbox mode. I have used plugin registration tool for license and a few other functions.
I have tried two ways.
First: When I tried to install the first time, I got unprocess status from workflow.
Second: To solve above issue, I have tried by removing Licence process related component. Now I am getting unprocess status from Plugin Assembly of Updating Sales Order.
The worst thing is I am not getting any error message or error code in log file.
Finally, here are a few logs. Can anybody suggest a solution?
--------------------------------------------------------------------------------------------------------
AsynchronousProcessingService Failed to add the item to the sync item collection for the mailbox : {8CBF53D0-896B-E611-80F2-FC15B4288714}. Exception details : Unhandled Exception: Microsoft.Crm.CrmArgumentException: Invalid input.
at Microsoft.Crm.Asynchronous.EmailConnector.ExchangeItemFinder.AddItemToSyncItemChangeInfoCollection(Item item, String itemId, SyncItemChangeType itemChangeType, ItemObjectType itemObjectType, String crmId)
Inner Exception: System.ArgumentException: Invalid input.
AsynchronousProcessingService Failed to add the item to the ItemFinder sync error collection for the mailbox : {8CBF53D0-896B-E611-80F2-FC15B4288714}. Exception details : Unhandled Exception: Microsoft.Crm.CrmArgumentException: Invalid input.
at Microsoft.Crm.Asynchronous.EmailConnector.ExchangeItemFinder.AddItemToItemFinderSyncErrors(String itemId, SyncItemChangeType itemChangeType, ItemObjectType itemObjectType, Exception ex)
Inner Exception: System.ArgumentException: Invalid input.
--------------------------------------------------------------------------------------------------------
WebApplicationServer MessageProcessor fail to process message 'InitializeFrom' for 'none'.
--------------------------------------------------------------------------------------------------------
WebApplicationServer InitializeFrom cannot be invoked from source entity of type account with id 89abd2b1-248f-e611-80f3-fc15b4282658 to target entity type task because there is no entity map defined between these two entities.
--------------------------------------------------------------------------------------------------------
WebApplicationServer Web Service Plug-in failed in SdkMessageProcessingStepId: 27cbbb1b-ea3e-db11-86a7-000a3a5473e8; EntityName: none; Stage: 30; MessageName: InitializeFrom; AssemblyName: Microsoft.Crm.Extensibility.InternalOperationPlugin, Microsoft.Crm.ObjectModel, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35; ClassName: Microsoft.Crm.Extensibility.InternalOperationPlugin; Exception: Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at System.Web.Services.Protocols.LogicalMethodInfo.Invoke(Object target, Object[] values)
at Microsoft.Crm.Extensibility.InternalOperationPlugin.Execute(IServiceProvider serviceProvider)
at Microsoft.Crm.Extensibility.V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
Inner Exception: Microsoft.Crm.CrmException: There is no entity map defined for the given entities
at Microsoft.Crm.ObjectModel.CustomizationService.InitializeFrom(BusinessEntityMoniker moniker, String targetEntityName, TargetFieldType targetFieldType, Boolean mapReadSecuredOnSourceAndTarget, ExecutionContext context)
at Microsoft.Crm.ObjectModel.CustomizationService.InitializeFrom(BusinessEntityMoniker moniker, String targetEntityName, TargetFieldType targetFieldType, ExecutionContext context)
--------------------------------------------------------------------------------------------------------
WebApplicationServer MessageProcessor fail to process message 'InitializeFrom' for 'none'.
--------------------------------------------------------------------------------------------------------
WebApplicationServer MSCRM Error Report:
Error: There is no entity map defined for the given entities
Error Number: 0x80040E01
Error Message: There is no entity map defined for the given entities
Error Details: There is no entity map defined for the given entities
Source File: Not available
Line Number: Not available
Request URL:
Stack Trace Info: [CrmException: There is no entity map defined for the given entities]
at Microsoft.Crm.Application.Platform.ServiceCommands.PlatformCommand.XrmExecuteInternal()
at Microsoft.Crm.Application.Platform.ServiceCommands.InitializeFromCommand.Execute()
*Update
Try turning off the plugins and workflows related to the entities and try again. Looks like you code have a bug in your plugin as well.
Based on the error message's it appears TFS does not permission to save the configuration file in the user roaming path:
Error Message: SaveConfigToFile() - fail - \\tpapsvmgmt01\UserMyDocs\sbrown\AppData\Roaming\Microsoft\PackageDeployer\Default_PackageDeployer.exe
Also, what version of the SDK are you using? It states you are using a pre 8.0 version. Ensure you have the latest SDK dll's.
PackageDeployment Information 8 4/4/2017 10:06:45 AM Executing Solution Import Pre v8.0
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Verbose 16 4/4/2017 10:08:43 AM Failed to Execute Command - ImportSolution
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Error 2 4/4/2017 10:08:43 AM Source : mscorlib
Method : HandleReturnMessage
Date : 4/4/2017
Time : 10:08:43 AM
Error : Message: Import failed
ErrorCode: -2147188706
Trace:
Stack Trace : Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.Servic
Could be the configuration setting that are being used to
Authentic because it is throwing error invoking channel proxy command.

nHibernate second-level cache with memcached and random invalid casts

I have an MVC3 application using nHibernate and memcached as the second level cache provider. We've been intermittently (but much more frequently lately) getting weird casting issues. It happens randomly and invalidating the memcached cache will fix the problem for while.
It only happens in our Production environment because we don't run memcached in our other environments. However I run memcached locally and have tried to get this to occur locally with no luck.
We are using memcached 1.2.6 on Windows. Here's the stack trace. I know it's not going to be enough information to determine anything but if anyone has any ideas about how I could debug this that would be appreciated. I'm trying to get remote debugging on our Production machine but it's a busy time of year and risky.
Unable to cast object of type 'System.Int32' to type 'System.String'.
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.InvalidCastException: Unable to cast object of type 'System.Int32' to type 'System.String'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[InvalidCastException: Unable to cast object of type 'System.Int32' to type 'System.String'.]
(Object , Object[] , SetterCallback ) +4270
NHibernate.Tuple.Entity.PocoEntityTuplizer.SetPropertyValuesWithOptimizer(Object entity, Object[] values) +80
[PropertyAccessException: Invalid Cast (check your mapping for property type mismatches); setter of MyApplication.Business.Data.Program]
NHibernate.Tuple.Entity.PocoEntityTuplizer.SetPropertyValuesWithOptimizer(Object entity, Object[] values) +207
NHibernate.Tuple.Entity.PocoEntityTuplizer.SetPropertyValues(Object entity, Object[] values) +97
NHibernate.Cache.Entry.CacheEntry.Assemble(Object[] values, Object result, Object id, IEntityPersister persister, IInterceptor interceptor, ISessionImplementor session) +306
NHibernate.Cache.Entry.CacheEntry.Assemble(Object instance, Object id, IEntityPersister persister, IInterceptor interceptor, ISessionImplementor session) +147
NHibernate.Event.Default.DefaultLoadEventListener.AssembleCacheEntry(CacheEntry entry, Object id, IEntityPersister persister, LoadEvent event) +434
NHibernate.Event.Default.DefaultLoadEventListener.LoadFromSecondLevelCache(LoadEvent event, IEntityPersister persister, LoadType options) +800
NHibernate.Event.Default.DefaultLoadEventListener.DoLoad(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options) +560
NHibernate.Event.Default.DefaultLoadEventListener.Load(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options) +229
NHibernate.Event.Default.DefaultLoadEventListener.ProxyOrLoad(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options) +438
NHibernate.Event.Default.DefaultLoadEventListener.OnLoad(LoadEvent event, LoadType loadType) +943
NHibernate.Impl.SessionImpl.FireLoad(LoadEvent event, LoadType loadType) +99
NHibernate.Impl.SessionImpl.Get(String entityName, Object id) +117
NHibernate.Impl.SessionImpl.Get(Object id) +70
MyApplication.Business.Repositories.Repository`1.Get(Object id) +148
We've been encountering the same issue and we have pinpointed the problem to invalid cache entries in the second level cache. In our case the problem arises when we add or remove columns/properties from tables/entities that are cached in the second level cache and deploy the change. The code expects five columns (for argument's sake) whereas the cache stores six columns.
One strategy that we employed in our repository is to catch the exception and invalidate the cache. We then retry the get.
public override T Get(int id)
{
try
{
return base.Get(id);
}
catch (InvalidCastException)
{
_sessionFactory.EvictEntity(typeof (T).Name);
return Get(id);
}
}
Hope this helps!
Most probably this is caused by different dataset returned by the queries on the production environment and your local. The object mapper is getting different data than what its expecting. When trying to convert the data then you are getting these exceptions.

Index out of range error in Telerik reporting

I am getting Server Error in '/' Application.
Exception Details:
System.ArgumentOutOfRangeException: Index was out of range. Must be
non-negative and less than the size of the collection. Parameter name:
index
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index]
System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) +67
System.ThrowHelper.ThrowArgumentOutOfRangeException() +16
System.Collections.Generic.List`1.get_Item(Int32 index) +19
Telerik.Reporting.HtmlRendering.HtmlElementRenderer.GetEndElement(ProcessingElement startElement) +267
Telerik.Reporting.HtmlRendering.HtmlElementRenderer.BeginRender(HtmlRenderingContext context) +382
Telerik.Reporting.HtmlRendering.BaseElementRenderer.RenderToHtml(HtmlRenderingContext context) +17
Telerik.Reporting.HtmlRendering.ContainerElementRenderer.Render(HtmlRenderingContext context) +108
Telerik.Reporting.HtmlRendering.BaseElementRenderer.RenderToHtml(HtmlRenderingContext context) +26
Telerik.Reporting.HtmlRendering.ContainerElementRenderer.Render(HtmlRenderingContext context) +108
Telerik.Reporting.HtmlRendering.BaseElementRenderer.RenderToHtml(HtmlRenderingContext context) +26
Telerik.Reporting.HtmlRendering.ContainerElementRenderer.Render(HtmlRenderingContext context) +108
Telerik.Reporting.HtmlRendering.BaseElementRenderer.RenderToHtml(HtmlRenderingContext context) +26
Telerik.Reporting.HtmlRendering.ContainerElementRenderer.Render(HtmlRenderingContext context) +108
Telerik.Reporting.HtmlRendering.BaseElementRenderer.RenderToHtml(HtmlRenderingContext context) +26
Telerik.Reporting.HtmlRendering.ContainerElementRenderer.Render(HtmlRenderingContext context) +108
Telerik.Reporting.HtmlRendering.BaseElementRenderer.RenderToHtml(HtmlRenderingContext context) +26
Telerik.Reporting.HtmlRendering.ContainerElementRenderer.Render(HtmlRenderingContext context) +108
Telerik.Reporting.HtmlRendering.BaseElementRenderer.RenderToHtml(HtmlRenderingContext context) +26
Telerik.Reporting.HtmlRendering.HtmlTextBoxRenderer.RenderInternal(ProcessingElement processingElement, HtmlRenderingContext context) +163
Telerik.Reporting.HtmlRendering.HtmlItemRender.Telerik.Reporting.HtmlRendering.IReportItemRender.Render(ProcessingElement processingElement, RenderingContext context) +92
Telerik.Reporting.HtmlRendering.RenderingContext.Render(ReportItemBase item) +50
Telerik.Reporting.HtmlRendering.Matrix.RenderInternal(HtmlRenderingContext context) +3645
Telerik.Reporting.HtmlRendering.Matrix.Render(HtmlRenderingContext context) +40
Telerik.Reporting.HtmlRendering.ReportSectionBaseRenderer.RenderInternal(ProcessingElement processingElement, HtmlRenderingContext context) +69
Telerik.Reporting.HtmlRendering.HtmlItemRender.Telerik.Reporting.HtmlRendering.IReportItemRender.Render(ProcessingElement processingElement, RenderingContext context) +92
Telerik.Reporting.HtmlRendering.RenderingContext.Render(ReportItemBase item) +50
Telerik.Reporting.HtmlRendering.HtmlPage.RenderReportSections(HtmlWriter bodyWriter) +557
Telerik.Reporting.HtmlRendering.HtmlPage.RenderBody(HtmlWriter bodyWriter) +320
Telerik.Reporting.HtmlRendering.HtmlPage.Render(HtmlTextWriter primaryWriter, HtmlRenderingContext renderingContext) +112
Telerik.Reporting.HtmlRendering.HtmlReport.Render(HtmlTextWriter writer, Int32 startPage, Int32 endPage) +304
Telerik.Reporting.HtmlRendering.HtmlReport.Render(HtmlTextWriter writer) +56
Telerik.Reporting.HtmlRendering.HtmlRenderingExtension.Telerik.Reporting.Processing.IRenderingExtension.Render(Report report, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback, EvaluateHeaderFooterExpressions evalHeaderFooterCallback) +134
Telerik.Reporting.Processing.ReportProcessor.Render(IList`1 reports, ExtensionInfo extensionInfo, Hashtable renderingContext, Hashtable deviceInfo, CreateStream createStreamCallback) +352
Telerik.Reporting.Processing.ReportProcessor.RenderReport(String format, IReportDocument reportDocument, Hashtable deviceInfo, CreateStream createStreamCallback, String& documentName) +421
Telerik.ReportViewer.WebForms.ServerReport.Render(HttpResponse response, String format, Int32 pageIndex) in c:\Projects\Reporting\FromSC_scrum\#ReportingBuild\Reporting_Build\Net20\Telerik.ReportViewer.WebForms\ServerReport.cs:90
Telerik.ReportViewer.WebForms.ReportPageOperation.PerformOperation(NameValueCollection urlQuery, HttpContext context) in c:\Projects\Reporting\FromSC_scrum\#ReportingBuild\Reporting_Build\Net20\Telerik.ReportViewer.WebForms\ReportPageOperation.cs:25
Telerik.ReportViewer.WebForms.HttpHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext context) in c:\Projects\Reporting\FromSC_scrum\#ReportingBuild\Reporting_Build\Net20\Telerik.ReportViewer.WebForms\HttpHandler.cs:59
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +705
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +137
I am getting this error in Telerik Report viewer.
Getting this error only for specific criteria not for all the values.
where i am missing something?
Please help me.
I have same problem. I didn't figured out its origin yet, but I suppose it comes from data source binding. When you create new instance on report it creates default controls in InitializeComponent() method (for example, List with 0 rows or TextBox without text). And when you bind data source (for example, List with 3 items) it refer to List (Telerik Reporting control) and try to bind collection with 3 items to control with 0 rows. So in this case you had OutOfRangeException. Something like that, I guess.
UPD: actually, I had resolved my problem yesterday. It was all because I try to bind empty collection as control's data source. I just added default object (with empty properties) to my collection if it contains no elements before binding.
We have been experiencing a very similar issue intermittently. Clearing out the Telerik state database tables seems to resolve it sometimes for us. You can flip #Condition to 1 in the script below to execute the delete.
DECLARE #Condition AS BIT = 0;
IF #Condition = 1
BEGIN
DELETE dbo.tr_AppLock;
DELETE dbo.tr_Object;
DELETE dbo.tr_Set;
DELETE dbo.tr_String;
END;
SELECT *
FROM dbo.tr_AppLock AS tal;
SELECT *
FROM dbo.tr_Object AS tob;
SELECT *
FROM dbo.tr_Set AS ts;
SELECT *
FROM dbo.tr_String AS ts;
Check that you can preview the report in the Telerik Report Designer.
I was seeing the same error when running code:
System.ArgumentOutOfRangeException: Index was out of range. Must be
non-negative and less than the size of the collection. Parameter name:
index
In the report designer I had the error:
Missing or invalid parameter value. Please input valid data for all
parameters
I corrected the Report Designer error (by adding a default parameter value, see screenshot below) and made no other 'code' changes, this resolved both issues.
Interestingly if I remove the default value the Report Designer error returns but running the report in code remains OK (possibly the report is cached somewhere in a valid state?)

How do I track down ValidateAntiForgeryToken not supplied issue?

I was looking at our logs and came across an error:
A required anti-forgery token was not supplied or was invalid.
It seems like one of the developers may have not added the token onto a page or did not send it via an AJAX call. The problem is I have no idea where in our code base this originated. It was logged by the [HandleError] logging code we added but we have no way of knowing which method caused this.
The stack trace only shows us the following which doesn't seem very helpful:
at System.Web.Helpers.AntiForgeryWorker.Validate(HttpContextBase
context, String salt) at
System.Web.Mvc.ControllerActionInvoker.InvokeAuthorizationFilters(ControllerContext
controllerContext, IList`1 filters, ActionDescriptor actionDescriptor)
at
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext
controllerContext, String actionName)
The OnException method in our BaseController looks as follows:
protected override void OnException(ExceptionContext filterContext)
{
Exception ex = filterContext.Exception;
//
// Custom logging code here was removed for brevity
if (filterContext.Exception.Data.Contains("Description") == false)
filterContext.Exception.Data.Add("Description", "Oops. Something went wrong!");
//Displays a friendly error, doesn't require HandleError
filterContext.ExceptionHandled = true;
//Displays a friendly error, *requires* HandlError
base.OnException(filterContext);
}
My question is:
Is there a way to get the source of the exception, ie. to know what controller or source file threw the exception using ExceptionContext.
Appreciate the help.
Based on BuildStarted's response, the answer lies in the RouteData property of filterContext. I have an object dumper that writes out the properties of any object and here is what I see in our logs now.
RouteData:
[0]: [controller, Assess]
[1]: [action, Setup]
[2]: [id, 2]
So now I know the exact method that caused this.

Resources