1

To integrate with the current system for continuous integration, we want to use NUnit for testing (non UI) Silverlight code. Doing this means executing Silverlight code using the runtime of the full .NET framework which usually works just fine as long as not actually using Silverlight specific classes such as the visual elements or DependencyObject. However, some general purpose libraries such as the Reactive Extensions for Silverlight also appears to have a dependency on the Silverlight runtime (agcore).

Is there a way of tricking the runtime into redirecting Silverlight runtime dependencies into some mock version of them? Or is it possible to redirect assembly references such as Reactive Extensions at runtime altogether (when running unit tests only) and load their corresponding counterpart for the full .NET framework instead?

4

1 回答 1

1

I would just roundtrip the DLLs using ildasm / ilasm and write a Perl script to munge the .il file - I do a similar trick to convert a .NET 2.0 DLL to 4.0 here:

http://blog.paulbetts.org/index.php/2009/12/03/convert-a-net-2-0-dll-to-net-4-0-without-sourc/

于 2010-07-09T05:24:10.263 回答