This is a migrated thread and some comments may be shown as answers.

Deployment Issue

4 Answers 145 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 05 Jul 2011, 07:36 AM
Hello,

We have followed the recommendation from http://www.telerik.com/help/winforms/installation-deployment-and-distribution-redestributing-telerik-radcontrols-for-windows.html and merged all the required Telerik WinControls DLLs into one assembly using ILMerge.

Now the problem is that as soon as we change the references in our Visual Studio 2010 project from the Telelerik.WinControls.*.dlls to the merged assembly, the designer view of the form fails to load and crashes Visual Studio 2010. If the designer view is not loaded, we can run in debug mode, etc and there are no problems with the resulting application deployed with the merged assembly.

I do believe that perhaps starting developing a radForm from scratch using the controls from the merged assembly (rather than the Telerik DLLs) would probably have solved this issue. But we are too far into our development to strip away everything and start designing the forms from scratch.

I was wondering if anyone else has come across this? If so, do we have a way of fixing this?

We are using WinControls version 2010.2.10.806 with Visual Studio 2010.

Regards.

4 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 05 Jul 2011, 09:47 AM
Hello Richard,

Have a look at this forum thread. There are several answers that I give here, and included is a small video showing merging the assemblies.

Hope this helps
Richard
0
Richard
Top achievements
Rank 1
answered on 06 Jul 2011, 01:18 AM

Richard, thanks for your prompt reply.

I have seen the KB Article: http://www.telerik.com/support/kb/winforms/general/ilmerge-telerik-winforms-assemblies.aspx and your video here.

As mentioned before, we are trying to go with the second approach - of merging multiple Telerik assemblies to one, and using this in our application.

We used the following commands to build the assembly PLWinFormsControls:

cd "C:\Program Files (x86)\Microsoft\ILMerge"

ilmerge /out:PLWinFormsControls.dll TelerikCommon.dll TelerikData.dll Telerik.WinControls.UI.dll Telerik.WinControls.UI.Design.dll Telerik.WinControls.dll Telerik.WinControls.GridView.dll Telerik.WinControls.Scheduler.dll Telerik.WinControls.Docking.dll Telerik.WinControls.RadChart.dll Telerik.WinControls.RadDock.dll Telerik.WinControls.RadMarkupEditor.dll

Then changed the reference from the separate Telerik dlls to PLWinFormsControls dll.
Also added the following line in Sub New()

 

RadTypeResolver.Instance.TypeResolverAssemblyName = "PLWinFormsControls"


While this run well in debug mode and runs fine on a test machine (without any Telerik dlls), visual studio crashes with the message "Visual Studio is attempting to load class instances from a different than the original used to create your components. This will result in failure to load your designed component." This happens when we try to load the main form in design view.

Please see the attached screenshot.

In other words we can deploy what we have, but we are unable to view (or change) the design of the form in Visual Studio, unless the references are reverted back to the different Telerik DLLs.

One thing that I didn't mention and that is different from the video (link) is that the application's main form is a RadForm. Therefore:

Public Class JobPlanner
    Inherits Telerik.WinControls.UI.RadForm

I am not sure if this would have anything to do with the designer problem.

I was wondering if anyone else has come across this problem?

0
Richard Slade
Top achievements
Rank 2
answered on 07 Jul 2011, 09:11 AM
Hello,

No, personally, I have never seen this happen, but have a look at this forum thread and also this one which may help.

If there's anything further you need, please let me know.
Thanks
Richard
0
Accepted
Jack
Telerik team
answered on 07 Jul 2011, 01:42 PM
Hello Richard,

You should use separate assemblies when developing and you should merge the assemblies with the executable only for the purposes of the deployment. This should be the final step before preparing the setup. This way you will be able to develop without problems at design time. 

I noticed that you merge the UI.Design assembly with other assemblies that your application is referencing. In fact this assembly is used only at design time and you should not merge it and you should not distribute the design assembly with your application. You can try referencing the Telerik.WinControls.UI.Design.dll assembly as a separate assembly and merging all other assemblies. This way MS Visual Studio will be able to load all control designer properly and you should not experience this issue.

I hope this helps. Should you have any further questions, do not hesitate to ask.

Greetings,
Jack
the Telerik team
Registration for Q2 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting July 18th and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
General Discussions
Asked by
Richard
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Richard
Top achievements
Rank 1
Jack
Telerik team
Share this question
or