I have been looking online for help with this error but it is a little complicated in my case. To begin with I am very new to C# and the second thing is.. I have the exact code in 2 different Solutions it works absolutely fine in one and in other it just wont.
So the difference between 2 solutions is:
One is an application with all the tabs in Windows Form and the other one is same application with all the tabs as user control.
I just want to understand why do we get the "There was an error reflecting type" error.
The part of the code where it gives the error is as follows:
Expand|Select|Wrap|Line Numbers
- if (File.Exists(str2))
- {
- FileInfo fileInfo1 = new FileInfo(str2);
- FileStream fileStream = File.OpenRead(str2);
- cConStd[num].Definition = CaStdXml.LoadCalStd<T>(fileStream, fileInfo1.Directory.FullName);
- }
Please help me understand this error. It been couple of hours I have been looking for it.
Thanks in advance!!
EDIT:
I checked the inner Exception and it shows the following at Stack Trace:
Expand|Select|Wrap|Line Numbers
- StackTrace " at System.Xml.Serialization.XmlReflectionImporter.InitializeStructMembers(StructMapping mapping, StructModel model, Boolean openModel, String typeName, RecursionLimiter limiter)\r\n at System.Xml.Serialization.XmlReflectionImporter.ImportStructLikeMapping(StructModel model, String ns, Boolean openModel, XmlAttributes a, RecursionLimiter limiter)\r\n at System.Xml.Serialization.XmlReflectionImporter.InitializeStructMembers(StructMapping mapping, StructModel model, Boolean openModel, String typeName, RecursionLimiter limiter)\r\n at System.Xml.Serialization.XmlReflectionImporter.ImportStructLikeMapping(StructModel model, String ns, Boolean openModel, XmlAttributes a, RecursionLimiter limiter)\r\n at System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel model, String ns, ImportContext context, String dataType, XmlAttributes a, Boolean repeats, Boolean openModel, RecursionLimiter limiter)" string