在带有 ASP.NET Web 服务的客户端和服务器上使用相同的 DTO 库

发布于 2024-09-09 06:07:27 字数 285 浏览 1 评论 0原文

您好,我有一个包含普通 DTO 类的 (silverlight) 类库。
对于此示例“Person”。

我有一个返回人员列表的 ASP.NET Web 服务 (.asmx)。

现在在消费端(silverlight)我想为 web 服务生成一个客户端存根。
这工作正常,但是,它为我生成了一个新的 Person 类..
我想重用现有的 DTO 人员类。

我尝试在引用的程序集中使用高级->重用类型,但直到现在都无济于事......

任何人都可以帮助我吗?

Hello I have a (silverlight) class library containing plain DTO classes.
For this example "Person".

I have a ASP.NET Webservice (.asmx) that returns a List of Person.

Now on the consuming side (silverlight) I want to generate a client stub for the webservice.
This works ok, however, it generates a NEW Person class for me..
I want to reuse my existing DTO person class.

I tried to use Advanced->reuse types in referenced assemblies but until now to no avail....

Can anybody help me with this ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱冒险 2024-09-16 06:07:27

您将无法执行此操作,因为 Silverlight 和 .NET 虽然相似,但使用完全不同的运行时和程序集。为 Silverlight 编译的程序集不能与 .NET CLR 一起使用,反之亦然。

You won't be able to do this because Silverlight and .NET, while similar, use completely different runtimes and assemblies. An assembly that is compiled for Silverlight cannot be used with the .NET CLR and vice-versa.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文