C#类库,Silverlight类库,ASTM Web服务WTH [英] C# class library, Silverlight class library , asmx web services WTH

查看:137
本文介绍了C#类库,Silverlight类库,ASTM Web服务WTH的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ASMX服务无法重用Silverlight类库,Silverlight应用程序需要专用的类库而不是C#类库.因此,我不得不将C#类库代码复制到Silverlight类库中才能与我的Silverlight应用程序一起使用,现在这不是问题所在.我想要这些问题的技术答案(如果可能的话,请深入探讨)

ASMX services do not have ability to reuse the Silverlight Class library and Silverlight application needs dedicated Class library and not the C# class library. So i had to duplicate the C# class library code to a Silverlight class library to work with my Silverlight application, now that was not the problem here. I would like technical answers(In depth if possible) to these questions

  • 为什么Silverlight需要专用的Silverlight类库.即使它在CLR上的某个层之上运行

  • Why is it that Silverlight needs dedicated Silverlight Class library. Even though it runs above a layer on CLR

ASMX服务上的方法返回C#类库实体,为什么它不是castable到类似的silverlight类

Methods on the ASMX service returns C# class library entities, why is this not castable to analogous silverlight class

我如何使ASMX服务与相同的类库一起工作(因为从webservice返回的实体似乎在智能感知中未在其上显示方法)

How do i make the ASMX service work with same class library ( because the entities returned from webservice does not seem to display methods on them in the intellisense)

推荐答案

好的,这就是答案. Silverlight类库与所有.NET平台兼容(因为它们是精简版).只需将类库编译为程序集,然后添加引用(而不是添加到项目中)即可.

OK here is the answer. Silverlight Class libraries are compatible with all .NET platforms (since they are stripped down version). Just do this compile the class library to assembly and then add reference (instead adding to the project).

  • Silverlight类库在幕后进行了其他引用(针对以silverlight平台为目标的程序集),因此silverlight也需要这些引用才能正常工作

  • Silverlight class library does additional references (to assemblies that target silverlight platform) behind the scenes hence silverlight also needs these references to work correctly

再次创建类的实例(没有简单的方法)

Create a instance of class again ( No simple way to do it)

方法实际上是元数据,无法在Webservice调用中通过电线进行传输.当再次从数据构造对象时,您可以调用方法

Methods are actually meta data, they cannot be transported through wire in a webservice call. You can invoke the methods when objects are constructed again from data

这篇关于C#类库,Silverlight类库,ASTM Web服务WTH的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆