Hello,
in order to avoid a deployment conflict I considered merging the Infragistics WinForms assemblies into a single assembly (using ILMerge). Since the release notes for v11 contain specific instructions on how to do it I assume this is a supported approach to deploy Infragistics.
A (simple) test application that I built using these merged assemblies ran ok - until I wanted to load an ISL file that has been built using the v11 AppStylist. StyleManager.Load throws a ReflectionTypeLoadException when deserializing a GlyphInfo data structure (or when reading an image - that's the next failure when I removed the Glyphs from the ILS file). Update: the exception during image load is handled but the exection for the GlyphInfo is not. The application terminates with this exception:
---> System.InvalidCastException: Unable to cast object of type 'Infragistics.Win.CheckBoxImageGlyphInfo' to type 'Infragistics.Win.GlyphInfoBase'. at Infragistics.Win.AppStyling.StyleUtilities.ParseGlyphInfo(String value) at Infragistics.Win.AppStyling.CustomPropertyInfo.LoadContents(XmlReader reader, StyleParseInfo parseInfo, String endTag) at Infragistics.Win.AppStyling.ComponentStyleInfo.Create(XmlReader reader, StyleParseInfo parseInfo) at Infragistics.Win.AppStyling.StyleSetInfo.LoadContents(StyleSetInfo styleSet, XmlReader reader, StyleParseInfo parseInfo, Boolean parseOnlyTargets) at Infragistics.Win.AppStyling.StyleSetInfo.LoadContents(StyleSetInfo styleSet, StyleParseInfo parseInfo, Boolean parseOnlyTargets) at Infragistics.Win.AppStyling.StyleSetInfo.Create(XmlReader reader, StyleParseInfo parseInfo) at Infragistics.Win.AppStyling.StyleLibraryInfo.Import(XmlReader reader, StyleLoadOption loadOption, StyleLibraryCategories categories) at Infragistics.Win.AppStyling.StyleLibraryInfo..ctor(Stream stream, StyleLoadOption loadOption, StyleLibraryCategories categories) at Infragistics.Win.AppStyling.StyleLibraryInfo..ctor(Stream stream, StyleLoadOption loadOption) at Infragistics.Win.AppStyling.StyleManager.Load(Stream stream, Boolean validate, String styleLibraryName) at Infragistics.Win.AppStyling.StyleManager.Load(Stream stream, Boolean validate)
I assume that the binary elements in the ISL file (in this case the GlyphInfo) are some serialized Infragistics types that cannot be found in the merged Infragistics assembly (since the type identity changed).
However, the Infragistics AppStylist of v13 can read the file properly. So there must be a way to read (and use?) this file even when the original assemblies are not available. Is that correct?
So the question is: is there a way I can make use of this ISL file with my merged Infragistics assemblies?
Thanks
Uwe
Hello Uwe,
I try to reproduce your issue using a small sample with UltraGrid. I merged these assemblies:
Infragistics4.Shared.v11.2
Infragistics4.Win.Misc.v11.2
Infragistics4.Win.UltraWinGrid.v11.2
Infragistics4.Win.v11.2
and after that I apply different AppStyles to my application and at a first look everything seems to works properly. Please take a look on attached video file for more details and if you think that I didn`t reproduce your scenario, please feel free to write me
Regards
Hello Georgi,
thanks for the quick response. Looks pretty much like what I try to do. Can you try to use the attached .ISL file? Could you please post the command line you were using for ILMerge?
Thanks and best regards
Thanks again - so I basically see two major differences to what you do:
1. I have added much more assemblies to the merge assembly than you do:
Infragistics2.Documents.Reports.v11.1.dllInfragistics2.Shared.v11.1.dllInfragistics2.Win.Misc.v11.1.dllInfragistics2.Win.UltraWinEditors.v11.1.dllInfragistics2.Win.UltraWinGrid.DocumentExport.v11.1.dllInfragistics2.Win.UltraWinGrid.v11.1.dllInfragistics2.Win.v11.1.dllInfragistics3.Documents.Excel.v11.1.dllInfragistics3.Documents.IO.v11.1.dllInfragistics3.Win.UltraWinFormattedText.WordWriter.v11.1.dllInfragistics3.Win.UltraWinGrid.ExcelExport.v11.1.dllInfragistics3.Win.UltraWinGrid.WordWriter.v11.1.dll
2. My command line looks a bit different:
"\Program Files (x86)\Microsoft\ILMerge\ILMerge.exe" Infragistics*.dll /wildcards /copyattrs /allowMultiple /allowDup /ndebug /closed /log:mergeresults.txt /out:UI.Merged.dll /targetplatform:v2,"C:\Windows\Microsoft.NET\Framework\v2.0.50727" /ver:1.0.0.1
In particular I have added the /copyattrs and /allowMultiple switches since these were mentioned in the release notes: http://dl.infragistics.com/community/winforms/ReleaseNotes/WindowsForms_11_1_May2012_SR_ReleaseNotes.pdf
My output has some duplicate type name warnings - I'm not sure if these are serious:
Merging assembly-level attributes from input assemblies for the target assembly.Merging assembly 'Infragistics2.Documents.Reports.v11.1' into target assembly.Assembly level attribute 'System.Security.AllowPartiallyTrustedCallersAttribute' from assembly 'Infragistics2.Documents.Reports.v11.1' being deleted from target assemblyMerging assembly 'Infragistics2.Shared.v11.1' into target assembly.Duplicate type name: modifying name of the type 'Infragistics.InfragisticsFeatureAttribute' (from assembly 'Infragistics2.Shared.v11.1') to 'Infragistics2.Shared.v11.1952.InfragisticsFeatureAttribute'Duplicate type name: modifying name of the type 'Infragistics.FeatureInfo' (from assembly 'Infragistics2.Shared.v11.1') to 'Infragistics2.Shared.v11.1952.FeatureInfo'Duplicate type name: modifying name of the type 'Infragistics.Shared.SR' (from assembly 'Infragistics2.Shared.v11.1') to 'Infragistics2.Shared.v11.1952.SR'Duplicate type name: modifying name of the type 'AssemblyRef' (from assembly 'Infragistics2.Shared.v11.1') to 'Infragistics2.Shared.v11.1952.AssemblyRef'Duplicate type name: modifying name of the type 'Infragistics.Shared.AssemblyVersion' (from assembly 'Infragistics2.Shared.v11.1') to 'Infragistics2.Shared.v11.1952.AssemblyVersion'Duplicate type name: modifying name of the type 'ResourceCustomizerLocator' (from assembly 'Infragistics2.Shared.v11.1') to 'Infragistics2.Shared.v11.1952.ResourceCustomizerLocator'Assembly level attribute 'System.Security.AllowPartiallyTrustedCallersAttribute' from assembly 'Infragistics2.Shared.v11.1' being deleted from target assembly
I will try to reduce the number of assemblies because I'm actually using only a subset (essentially the ones you have plus UltraWinEditors). Regarding the IL merge command line I'm not sure whether I can safely omit all parameters (as you did) given the explicit advice in the release notes.
Thanks for the details. I try to reproduce your issue using version 11.2 with CLR2.0, your AppStyle and these assemblies below
Infragistics2.Shared.v11.1.dll
Infragistics2.Win.Misc.v11.1.dll
Infragistics2.Win.UltraWinEditors.v11.1.dll
Infragistics2.Win.UltraWinGrid.v11.1.dll
Infragistics2.Win.v11.1.dll
and everything works properly. After that I repeat my test again, but this time I used version 11.1 - 11.1.20111.2111 (like it is in your scenario), your AppStyle and I was able to reproduce the same issue that you describe. But when I change your AppStyle with one of our default styles (for example IG or Nautilus) the same sample works properly.
So, I think that we have two possible options to solve your problem.
Option 1: If it is possible for you, you could upgrade your project to version 11.2 or higher
Option 2: To modify your AppStyle in a GlyphInfo part
Please note that in my tests I used "/copyattrs /allowMultiple"
Let me know if you have any questions.
thanks again - I really appreciate the responsive support you provide!
I think we will probably move on to version 11.2. I assume the problem does not exist with the most current version, too (13.2 afaik) - so we will consider this option, too.
Best regards
I do not have 11.2 available (all colleagues with the appropriate licenses are not in the office today - others have access for v12 and later but they don't get access to the older ones - nasty).
I wanted to check the 13.2 option anyway - so I tried with my trial download of that.
Unfortunately the merging fails there. I did the following:
"\Program Files (x86)\Microsoft\ILMerge\ILMerge.exe" /copyattrs /allowMultiple /log:mergeresults.txt /out:Merged.UI.Ext.dll /targetplatform:v4,"C:\Windows\Microsoft.NET\Framework\v4.0.30319" Infragistics4.Win.v13.2.dll Infragistics4.Shared.v13.2.dll Infragistics4.Win.Misc.v13.2.dll Infragistics4.Win.UltraWinGrid.v13.2.dll Infragistics4.Win.UltraWinEditors.v13.2.dll
I get the error:
ERROR!!: Duplicate type 'Infragistics.Win.UIAutomation.UiaProviderControlNativeWindow' found in assembly 'Infragistics4.Win.UltraWinGrid.v13.2'. Do you want to use the /alllowDup option?An exception occurred during merging:ILMerge.Merge: ERROR!!: Duplicate type 'Infragistics.Win.UIAutomation.UiaProviderControlNativeWindow' found in assembly 'Infragistics4.Win.UltraWinGrid.v13.2'. Do you want to use the /alllowDup option? at ILMerging.ILMerge.MergeInAssembly(AssemblyNode a, Boolean makeNonPublic, Boolean targetAssemblyIsComVisible) at ILMerging.ILMerge.Merge() at ILMerging.ILMerge.Main(String[] args)
No output is generated. Adding the /allowDup option generates:
An exception occurred during merging:Unresolved assembly reference not allowed: UIAutomationProvider. at System.Compiler.Ir2md.GetAssemblyRefIndex(AssemblyNode assembly) at System.Compiler.Ir2md.GetTypeRefIndex(TypeNode type) at System.Compiler.Ir2md.VisitReferencedType(TypeNode type) at System.Compiler.Ir2md.VisitMethod(Method method) at System.Compiler.Ir2md.VisitInterface(Interface Interface) at System.Compiler.Ir2md.VisitModule(Module module) at System.Compiler.Ir2md.SetupMetadataWriter(String debugSymbolsLocation) at System.Compiler.Ir2md.WritePE(Module module, String debugSymbolsLocation, BinaryWriter writer) at System.Compiler.Writer.WritePE(String location, Boolean writeDebugSymbols, Module module, Boolean delaySign, String keyFileName, String keyName) at System.Compiler.Writer.WritePE(CompilerParameters compilerParameters, Module module) at ILMerging.ILMerge.Merge() at ILMerging.ILMerge.Main(String[] args)
Again not output is generated.
Isn't it possible to merge the v13.2 assemblies?
In the meantime confirmed that it works with 11.2. I will close this thread and submit a new question for the 13.2 merge issue mentioned above.
Thanks for your response. I`ll check with version 13.2 and I`ll inform you about results in your new thread: http://es.infragistics.com/community/forums/t/85789.aspx