Der Wert darf nicht NULL sein.
Parametername: member.MemberInfo
My question is similiar how to identify such a problem?
How to find this Properties or Rules?
Der Wert darf nicht NULL sein.
Parametername: member.MemberInfo
My question is similiar how to identify such a problem?
How to find this Properties or Rules?
We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.
Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.
Starting with v18.1, we have introduced checks for type and member info existence at the core level. If a type or member is not existent, the exception will be thrown by default:
NOTE: Type and member info is mandatory as ALL standard and third-party modules rely on it. We do NOT recommend disabling this check in production, because your application will still fail later (you may not notice it and it will happen on an end-user machine).
Typical but not all scenarios where you may see this error are:
- Code changes to an underlying object type structure. For instance, class renaming or removing, namespace or assembly changing; member renaming, removing or its underlying type changing (also applied to custom fields added at runtime).
- Invalid model differences for changed types and members are still present (e.g., for ListView columns and a DetailView layout, appearance and validation rules).
Possible ways to handle these consequences are described below:
Task-Based Help > How to: Handle Renamings and Deletions of Business Classes and their Properties
Graceful way to handle bad user diff models
How to disable this behavior?
Disabling this check may be useful only temporarily, in a development environment for troubleshooting the aforementioned issues. You can set the static ApplicationModelManager.RaiseExceptionOnRequiredProperty property to False in the YourSolutionName.Module/Module.xx file:
C#...
using DevExpress.ExpressApp;
namespace MainDemo.Module {
public sealed partial class MainDemoModule : ModuleBase {
public MainDemoModule() {
InitializeComponent();
ApplicationModelManager.RaiseExceptionOnRequiredProperty = false;
...
Visual Basic'...
Imports DevExpress.ExpressApp
Namespace MainDemo.Module
Public NotInheritable Partial Class MainDemoModule
Inherits ModuleBase
Public Sub New()
InitializeComponent()
ApplicationModelManager.RaiseExceptionOnRequiredProperty = False;
End Sub
'...
Possible ways to handle these consequences are described below:
(…)
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hello,
The causes of such kind of issues are different and there is no universal way to diagnose them. You can try to debug your application using PDB files as described here: KA18843: How can I debug DevExpress .NET source code using PDB files to see what exactly code leads to the error. If it doesn't help, provide us with a simple example that illustrates the behavior and we will research it at our side.
Thanks,
Andrey
This I will do.
But it would be great when you may can give a hint in the exception where this problem come from.
In such a situation, we check that a variable is not null and raises an exception with the variable name. Providing additional information here is excessive and costs resources. It is usually better to find the cause of the exception and fix it. Would you please share the results of your investigation or a simple example that illustrates the problem with us so that we can analyze it?
Thanks,
Andrey
there are several problems.
I Identified those:
Changing a underlaing persistent type.
E.g.
- Property A is referencing Class C1. You change it to C2 then this problem occurs often ( not always).
- a persistent runtime property been added, than removed than this can happen.
- It happens whenever a structural change was done type or reference to type.
So my request is:
Hello Wolfram,
Thanks for your update. We need some additional information from you to better understand how to improve this situation.
Q1: Am I correct that currently you receive this error from the XtraReportDataTypeProvider.FillRelatedTypes method and your callstack is the same as in the T357936 thread?
Q2: As far as I understand, you are the primary person who is able to diagnose and correct such situations in the application. If so, the easiest way to do this is using debugging as we suggested above. For instance, you can analyze the "modelClass" variable to detect the problematic class and analyze its settings. To narrow down your search results, you can debug the DevExpress sources further to inspect the "member" or "member.MemberInfo" variables. Do you have problems with the current debugging capabilities? Or this error also occurs for already deployed apps? If so, how is it difficult for you to debug them using the described method?
Regardless of this, our team will also take your other suggestions into account. Here I also wanted to note that we will unlikely introduce such diagnostics into the FillRelatedTypes method, because it is a part of the pluggable ReportsV2 module. If we decide to improve diagnosing such situations, we will likely implement it at the core level. Finally, it is unsafe to write this error only to the log file without informing developers explicitly. This is a serious error and thus further application execution may fail, because its parts expect that there will be no invalid class members.
Hi Dennis,
i have to note here that we also have such situations. It can happen like T357936 which i had myself two weeks ago. It was in an deployed application where there was some wrong configuration in the application model. To find the error we had to get the database and debug related methods to find the affected modelclass. so it would be helpfull at least to get the affected class name in the exception, it would help to find the wrong model class more easily.
Thanks, Martin!
Q1: Am I correct that currently you receive this error from the XtraReportDataTypeProvider.FillRelatedTypes method and your callstack is the same as in the T357936 thread?
Thats correct ReportV2 is an incorrect error message.Even we received this error message and searched in a wrong direction.
This Errormessage appears when you habe a wrong Appearancerule e.g. The Type where this appearancerule points to is not valid any more.
Q2: As far as I understand, you are the primary person who is able to diagnose and correct such situations in the application. If so, the easiest way to do this is using debugging as we suggested above.
Exact this is what I'm doing, but It's much easier for me when you show the path.
Do you have problems with the current debugging capabilities? Or this error also occurs for already deployed apps? If so, how is it difficult for you to debug them using the described method?
Yes it is difficult, I need to backup the customers db ( 30 - 40 GB sometimes ) than load here than start to debug. It consumes up to 1 day.
Here I also wanted to note that we will unlikely introduce such diagnostics into the FillRelatedTypes method, because it is a part of the pluggable ReportsV2 module.
Ok, is this the reason that wrong rules throw a ReportsV2 exception? Even it has nothing todo with this module?
This is a serious error and thus further application execution may fail, because its parts expect that there will be no invalid class members.
Sure it's serious but I need Instruments to correct it wihtout Visual Studio.
@Martin Praxmarer,. Good to see that I'm not the only person with this problems.
Hello Wolfram,
Thank you for your answers. I admit that debugging this problem in a production app with a client database can be problematic.
>>Ok, is this the reason that wrong rules throw a ReportsV2 exception? Even it has nothing todo with this module?
The reason that you receive this error the ReportV2 module is just a coincidence, because this module checks data for validity. We received similar reports in the past (
https://search.devexpress.com/?q=FillRelatedTypes&f=&m=SupportCenter) and we will see if we can introduce a meaningful diagnostic message to at least let you guys determine problematic classes and members without debugging. At first glance, this should not be difficult.
It happens exactly here.
And here you have every data to log a proper Errormessage…
ReportExtension.cs
private static void FillRelatedTypes(IModelClass modelClass, IModelBOModel modelBOModel, IDictionary<Type, string> result, bool includeEnums, ITypesInfo typesInfo) {
foreach(IModelMember member in modelClass.AllMembers) {
Guard.ArgumentNotNull(member.MemberInfo, "member.MemberInfo");
Guard.ArgumentNotNull(member.MemberInfo.MemberTypeInfo, "member.MemberInfo.MemberTypeInfo");
Guard.ArgumentNotNull(member.Type, "member.Type");
ITypeInfo typeInfo = typesInfo.FindTypeInfo(member.Type);
Type memberType = typeInfo.Type;
if(member.MemberInfo.MemberTypeInfo.IsDomainComponent && member.MemberInfo.MemberTypeInfo.IsPersistent) {
if(!result.ContainsKey(memberType)) {
IModelClass currentMemberModelClass = modelBOModel.GetClass(memberType);
result.Add(currentMemberModelClass.TypeInfo.Type, currentMemberModelClass.Caption);
FillRelatedTypes(currentMemberModelClass, modelBOModel, result, includeEnums, typesInfo);
}
}
if(includeEnums && memberType.IsEnum) {
if(!result.ContainsKey(memberType)) {
result.Add(memberType, CaptionHelper.GetLocalizedText("Enums", memberType.FullName, memberType.Name));
}
}
}
}
Yes, that is the XtraReportDataTypeProvider.FillRelatedTypes method I also meant above.