【问题标题】:Can a service reference reuse classes from the assembly that is adding the reference?服务引用可以重用添加引用的程序集中的类吗?
【发布时间】:2011-01-07 01:15:51
【问题描述】:

如果我想重用的类在另一个程序集中,我没有问题。

但是,如果我想向包含我希望重用服务引用的类的程序集添加服务引用,它们不会被重用。正如here 指出的那样,我怀疑它与它的工作方式有关:

The service reference code generator is unable to recognize the re-used types unless the referenced assembly that contains the re-used types is built and on the disk.

显然,由于我要添加引用的程序集还包含类,因此它不能按原样在磁盘上为代码生成器编译。这是一种catch-22。但是有没有一种简单的方法来实现这一点,而无需手动创建服务引用或为我的模型使用附属程序集?

【问题讨论】:

    标签: .net code-generation service-reference


    【解决方案1】:

    我解决了!有时经过一段时间的思考,将其写在此处会让您以某种方式产生不同的想法……无论如何,我目前的解决方案是在另一个程序集中生成服务引用,然后将其复制并更新命名空间。简单!

    【讨论】:

    • 绝对!!我想我会从事制作它们的业务。
    猜你喜欢
    • 2017-03-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-14
    • 1970-01-01
    • 1970-01-01
    • 2023-03-18
    相关资源
    最近更新 更多