views:

36

answers:

1

Hi, I am trying to merge all the assemblies of an class library in a single .dll file.

I can merge all the assemblies using the Ilmerge but is that when I use the merged dll in a Silverlight application I am having trouble when a template is apply to my control and binding problems if I use a control that inherits with UserControl.

is there any solution to solve this problem?

A: 

The problem is that when the initial dlls are built the Xaml in the project is added as a resource in the dll. The code generated to load this xaml will look something like this:-

System.Windows.Application.LoadComponent(this, new System.Uri("/SilverlightLibrary1;component/MyControl.xaml", System.UriKind.Relative));

Note how the name of the dll forms part of the Uri need to fetch the xaml. I doubt IlMerge is able to spot that and fix it up. Hence once merged the Uris cannot be found.

A resolution for this is probably uglier than multiple references or simply creating another project that links all the code files involved.

AnthonyWJones