Hello,
a few users of one of our customers currently experience the following issue when our program calls Infragistics.Win.UltraWinGrid.UltraGridLayout.LoadFromXml(Stream stream, PropertyCategories propertyCategories).
The stream is a memory stream and propertyCategories is set to PropertyCategories.All.
This results in a System.Reflection.TargetInvocationException.
The strange thing about this is, that no matter the source of the XML (in this case it is actually created in memory and loaded from anywhere) this fails. I have compared the XML with the XML on a machine where it worked and did not find any significant differences.
This issue on comes up on very few specific computers and not anywhere else.
We have checked the GAC and the folder our software has been deployed in and there are no anomalies either.
The users culture is US English.
Has anybody else experienced a similar error?
Here is the call stack
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.FormatException: Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at Infragistics.Win.UltraWinGrid.SortedColumnsCollection..ctor(SerializationInfo info, StreamingContext context)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._SerializationInvoke(Object target, SignatureStruct& declaringTypeSig, SerializationInfo info, StreamingContext context)
at System.RuntimeMethodHandle.SerializationInvoke(Object target, SignatureStruct declaringTypeSig, SerializationInfo info, StreamingContext context)
at System.Reflection.RuntimeConstructorInfo.SerializationInvoke(Object target, SerializationInfo info, StreamingContext context)
at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)
at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at System.Runtime.Serialization.Formatters.Soap.ObjectReader.Deserialize(HeaderHandler handler, ISerParser serParser)
at System.Runtime.Serialization.Formatters.Soap.SoapFormatter.Deserialize(Stream serializationStream, HeaderHandler handler)
at System.Runtime.Serialization.Formatters.Soap.SoapFormatter.Deserialize(Stream serializationStream)
at Infragistics.Win.UltraWinGrid.UltraGridLayout.LoadHelper(Stream stream, PropertyCategories propertyCategories, IFormatter formatter)
at Infragistics.Win.UltraWinGrid.UltraGridLayout.LoadFromXml(Stream stream, PropertyCategories propertyCategories)
Best regards
Sebastian PeschtiesLogimatic Germany GmbH
That exception can sometimes occur when you have two different assemblies interacting with each other and one of them has changed the signature of a method so that the first one calls a method which no longer exists. Is it possible that the stream is being passed from another process or another thread?
Could it be that the machines in question are using an older version of the Infragistics components than the machine you developed on?
wrong assemblies was what I expected to, but we got a list of the GAC and a list of the files in the folder our application was deployed to via Click Once. Both seemed to be ok.In order to get more detailed information we will write the loaded assemblies to the a log file and check those. Maybe it is more conclusive.
Multiple threads as a source can be excluded. We are not using multithreading where this error occurs and it currently only effects three specific computers. Reproducable, whenever a layout is assigned.
replied twice..and my replies don't even show up here....
As the above reply is shown. I am now writing the real reply.
Yes. I am using the latest 9.1 service release. (9.1.20091.2029)
And, when you save the grid layout with "SaveAsXml", doesn't Infragistics save as the following? Isn't that specific version in a1 the problem???
<a1:UltraGridDisplayLayout id="ref-1" xmlns:a1="http://schemas.microsoft.com/clr/nsassem/Infragistics.Win.UltraWinGrid/Infragistics2.Win.UltraWinGrid.v8.2"
>
xmlns:a1
="http://schemas.microsoft.com/clr/nsassem/Infragistics.Win.UltraWinGrid/Infragistics2.Win.UltraWinGrid.v8.2"
Hi,
If you are using the latest service release and still having a problem, then it sounds like there's a bug there somewhere. In order to look into it, though, we need to be able to duplicate the problem. Can you provide a small sample project demonstrating the error?
tboy79 said:And, when you save the grid layout with "SaveAsXml", doesn't Infragistics save as the following? Isn't that specific version in a1 the problem???
No, the fact that the XML contains a version number is not a problem, because the binder resolves the corret assembly version when the layout is loaded.
Hi, I can confirm the behavior mentioned above.
We’ve had the same issues moving from 6.3 to 8.2 to 9.1 and have always had to make the customer scrap their saved grid settings (always a pain). If this could be fixed, it would be much appreciated. We’ve used both the load and save method to read and write streams as well as the SaveAsXML and LoadFromXML methods and get the same error.
To duplicate the issue, here’s what you can do:
You should get the following error:
“Exception has been thrown by the target of an invocation.”
The inner exception is “Unable to cast object of type ‘Infragistics.Win.AppearanceHolder’ to type ‘Infragistics.Win.AppearanceHolder’.”
Source: Infragistics2.Win.UltraWinGrid.v9.1
Stacktrace: at Infragistics.Win.UltraWinGrid.SpecialBoxBase..ctor(SerializationInfo info, StreamingContext context)
at Infragistics.Win.UltraWinGrid.GroupByBox..ctor(SerializationInfo info, StreamingContext context)
This error occurred when loading the grid settings saved by a 6.3 version of the grid into a project using a 9.1 version of the grid (with hotfix).
Hi Anthony,
Can anyone provide a couple of sample project with an old version of the controls that saves a layout and then a new version which fails to load the saved file?
I do this kind of thing all the time and I have never had a problem like you are describing, so my only guess here is that it's some particular combination of property settings that is causing the errors.
There is no reason why you should not be able to load a layout from an older version of the grid into a newer version.
Hi Mike,
Thanks for your help.
For now we are looking for some other options to restore the layout.
Thanks
Rooma
Well, if you can post a sample that demonstrates that, I would be happy to take a look at it. But without a sample, I'm afraid I have no idea why it's not working. Maybe your database is somehow altering the text for some reason.
Yes, I replaced my code with code given by you.
And still getting same exception.
Are you getting the same exception?
Are you sure you are not using the encoder any more?
Thanks for reply.
I tried using streamReader/Writer but it still does'n work. :(