是否可以使用完整 .NET 框架的运行时来运行 Silverlight 代码?
为了与当前系统集成进行持续集成,我们希望使用 NUnit 来测试(非 UI)Silverlight 代码。这样做意味着使用完整 .NET 框架的运行时执行 Silverlight 代码,只要不实际使用 Silverlight 特定类(例如可视元素或 DependencyObject),该框架通常就可以正常工作。但是,一些通用库(例如 Silverlight 的反应式扩展)似乎也依赖于 Silverlight 运行时 (agcore)。
有没有办法欺骗运行时将 Silverlight 运行时依赖项重定向到它们的某个模拟版本?或者是否可以在运行时完全重定向程序集引用,例如反应式扩展(仅在运行单元测试时)并加载完整 .NET 框架的相应对应部分?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我只是使用 ildasm / ilasm 往返 DLL 并编写一个 Perl 脚本来处理 .il 文件 - 我在这里使用类似的技巧将 .NET 2.0 DLL 转换为 4.0:
http://blog .paulbetts.org/index.php/2009/12/03/convert-a-net-2-0-dll-to-net-4-0-without-sourc/
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/