views:

53

answers:

1

In desktop CLR using AssemblyBuilder, how do I emit a silverlight application?

I want to dynamically create a new silverlight application within the desktop clr.

Should I use ildasm to relink base assemblies as shown here? http://www.codeproject.com/KB/silverlight/SLAssemblies.aspx

+1  A: 

Neither the MS Emit supports it, nor does Monos, nor does Cecil, nor does IKVM.Reflection.Emit.

The closest one seems to be the latter: From the 29th Jan 2010 release notes:

I've modified ikvmc to use IKVM.Reflection and largely rewritten ikvmstub to directly work with the ikvm internals instead of using the java reflection API. Both ikvmc and ikvmstub can now process assemblies independent from the .NET runtime they run on. This opens up the possibility to start investigating the possibility of Silverlight support.

So your best bet at this time is probably to generate C# or ILASM to a text file and use the existing tools.

Cine