Hello, I wonder if you can help with my issue.
In short, I am getting the exception (as in the post's title) when I get to the following line of code:
document = new RadFixedDocument();
RadFixedPage page = document.Pages.AddPage();
editor = new FixedContentEditor(page); // <<-- exception here
The things to note are:
1. No exception is thrown when the project is run from Visual Studio.
2. The exception is thrown when the merged assembly is run, that is after it has been merged with ILMerge.
3. The merging worked fine UNTIL I have added the Telerik.WinControls.PdfViewer.dll (and the related Telerik.Windows.Documents.Core.dll and Telerik.Windows.Documents.Fixed) assemblies to ILMerge script and then tried to instantiate the FixedContentEditor when executing the merged assembly.
That is, I have been using ILMerge for months with over 20 merged Telerik assemblies--no problem! It's only now that I started instantiating the FixedContentEditor so I assume it is the merged Telerik.Windows.Documents.Fixed.dll assembly that's throwing a wobbly somewhere.
By the way, the ILMerge throws no errors or warnings and the merging completes just fine. When I then run the merged assembly, it runs fine until I access the function that executes the code snipped above (that is, all other Telerik controls render correctly, etc.).
This seems to indicates it is not an issue with the ILMerge process per se. I wonder if there are some weird WPF dependencies somewhere. Even though it is a WinForms project and according to the Telerik documentation the FixedContentEditor can be used in WinForm applications, I noticed I had to refer to WindowsBase.dll in the project references because of two silly lines of code which refer to the System.Windows.Size struct.
maxWidth = page.Size.Width - defaultLeftIndent * 2; <<-- does not compile without WindowsBase.dll reference add
maxHeight = page.Size.Height - currentTopOffset * 2; <<-- does not compile without WindowsBase.dll reference add
I have attached the merge script below and also screenshots my project references and successfully completed ILMerge process.
Thank you!
-----------------
merge.bat below
ilmerge /target:winexe /out:F:\OFFLINE\GULMAY\VMP1_Pro\Setup\VMP2.exe /targetplatform:"v4, C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0" F:\OFFLINE\GULMAY\VMP1_Pro\VMP1Pro\VMP1Pro\bin\Release\VMP2.exe TelerikCommon.dll Telerik.WinControls.UI.dll Telerik.WinControls.dll Telerik.WinControls.Themes.Windows7.dll Telerik.WinControls.Themes.VisualStudio2012Light.dll Telerik.WinControls.Themes.VisualStudio2012Dark.dll Telerik.WinControls.Themes.TelerikMetroBlue.dll Telerik.WinControls.Themes.TelerikMetro.dll Telerik.WinControls.Themes.Office2013Light.dll Telerik.WinControls.Themes.Office2013Dark.dll Telerik.WinControls.Themes.Office2010Silver.dll Telerik.WinControls.Themes.Office2010Blue.dll Telerik.WinControls.Themes.HighContrastBlack.dll Telerik.WinControls.Themes.Desert.dll Telerik.WinControls.Themes.Breeze.dll Telerik.WinControls.Themes.Aqua.dll Telerik.WinControls.GridView.dll Telerik.Windows.Documents.Core.dll Telerik.Windows.Documents.Fixed.dll Telerik.Windows.Zip.dll Telerik.WinControls.PdfViewer.dll
In short, I am getting the exception (as in the post's title) when I get to the following line of code:
document = new RadFixedDocument();
RadFixedPage page = document.Pages.AddPage();
editor = new FixedContentEditor(page); // <<-- exception here
The things to note are:
1. No exception is thrown when the project is run from Visual Studio.
2. The exception is thrown when the merged assembly is run, that is after it has been merged with ILMerge.
3. The merging worked fine UNTIL I have added the Telerik.WinControls.PdfViewer.dll (and the related Telerik.Windows.Documents.Core.dll and Telerik.Windows.Documents.Fixed) assemblies to ILMerge script and then tried to instantiate the FixedContentEditor when executing the merged assembly.
That is, I have been using ILMerge for months with over 20 merged Telerik assemblies--no problem! It's only now that I started instantiating the FixedContentEditor so I assume it is the merged Telerik.Windows.Documents.Fixed.dll assembly that's throwing a wobbly somewhere.
By the way, the ILMerge throws no errors or warnings and the merging completes just fine. When I then run the merged assembly, it runs fine until I access the function that executes the code snipped above (that is, all other Telerik controls render correctly, etc.).
This seems to indicates it is not an issue with the ILMerge process per se. I wonder if there are some weird WPF dependencies somewhere. Even though it is a WinForms project and according to the Telerik documentation the FixedContentEditor can be used in WinForm applications, I noticed I had to refer to WindowsBase.dll in the project references because of two silly lines of code which refer to the System.Windows.Size struct.
maxWidth = page.Size.Width - defaultLeftIndent * 2; <<-- does not compile without WindowsBase.dll reference add
maxHeight = page.Size.Height - currentTopOffset * 2; <<-- does not compile without WindowsBase.dll reference add
I have attached the merge script below and also screenshots my project references and successfully completed ILMerge process.
Thank you!
-----------------
merge.bat below
ilmerge /target:winexe /out:F:\OFFLINE\GULMAY\VMP1_Pro\Setup\VMP2.exe /targetplatform:"v4, C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0" F:\OFFLINE\GULMAY\VMP1_Pro\VMP1Pro\VMP1Pro\bin\Release\VMP2.exe TelerikCommon.dll Telerik.WinControls.UI.dll Telerik.WinControls.dll Telerik.WinControls.Themes.Windows7.dll Telerik.WinControls.Themes.VisualStudio2012Light.dll Telerik.WinControls.Themes.VisualStudio2012Dark.dll Telerik.WinControls.Themes.TelerikMetroBlue.dll Telerik.WinControls.Themes.TelerikMetro.dll Telerik.WinControls.Themes.Office2013Light.dll Telerik.WinControls.Themes.Office2013Dark.dll Telerik.WinControls.Themes.Office2010Silver.dll Telerik.WinControls.Themes.Office2010Blue.dll Telerik.WinControls.Themes.HighContrastBlack.dll Telerik.WinControls.Themes.Desert.dll Telerik.WinControls.Themes.Breeze.dll Telerik.WinControls.Themes.Aqua.dll Telerik.WinControls.GridView.dll Telerik.Windows.Documents.Core.dll Telerik.Windows.Documents.Fixed.dll Telerik.Windows.Zip.dll Telerik.WinControls.PdfViewer.dll