Is there any way to consume .NET 4.0 assemblies in Silverlight
Silverlight can only recognize its v2.0.5.0 assemblies. The way to consume .NET 2.x/3.x assemblies in Silverlight truly exists. If I want to call, such as the method of Json class provided by System.Runtime.Serialization assembly, which is just in .NET 4.0, not in Silverlight v2.0.5.0, what can I do? Can I only consume the class and method in .NET 4.0 assemblies which can only be found in Silver开发者_如何学Golight v2.0.5.0 assemblies at the same time?
Another case is that some http classes and methods are in System.Web assembly in .NET 4.0 and also only in System.ServiceModel assembly in Silverlight v2.0.5.0. Should I do as the following way to consume these classes and methods in .NET 4.0
- ILDasm xxx.dll /out:xxx.il
- change sth in the IL file(how to do it???)
- ilasm xxx.il /dll /resource:xxx.res /out:xxxx.dll
No, you cannot access .NET 4 assemblies this way.
The ILDASM hack you list isn't going to work: System.Web is a very complex system, and it has dependencies on other parts of the framework.
精彩评论