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
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 and best regards
Hello Uwe,
Thanks for attached AppStyle. I made quick test using my sample and your Style and I think that everything works properly. Please take a look on attached video file with one of my tests.
Here is the PostBuild event that I used to merge these assemblies:
“C:\Program Files (x86)\Microsoft\ILMerge\ILMerge.exe” /log:"D:\Workdir\Projects\UltraGridCustomFilterILMerge\UltraGridCustomFilterILMerge\ILMerge.log" /out:"D:\Workdir\Projects\UltraGridCustomFilterILMerge\UltraGridCustomFilterILMerge\PublishMerged1.dll" "D:\Workdir\Projects\UltraGridCustomFilterILMerge\UltraGridCustomFilterILMerge\bin\Debug\Infragistics4.Shared.v11.2.dll" "D:\Workdir\Projects\UltraGridCustomFilterILMerge\UltraGridCustomFilterILMerge\bin\Debug\Infragistics4.Win.Misc.v11.2.dll" "D:\Workdir\Projects\UltraGridCustomFilterILMerge\UltraGridCustomFilterILMerge\bin\Debug\Infragistics4.Win.UltraWinGrid.v11.2.dll" "D:\Workdir\Projects\UltraGridCustomFilterILMerge\UltraGridCustomFilterILMerge\bin\Debug\Infragistics4.Win.v11.2.dll"
Let me know if you have any questions.
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?
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