"重用现有的类型和QUOT;添加服务引用时被忽略 [英] "Reuse existing types" is ignored when adding a service reference

查看:208
本文介绍了"重用现有的类型和QUOT;添加服务引用时被忽略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我加入一个服务引用我的一个项目在Visual Studio 2008在服务引用设置界面,我选择默认选项,它说:再利用类型中的所有引用的程序集。我已经提到了,我想重用一个类型的项目。这种类型被传递作为一个参数传递到Web方法。

I am adding a service reference to one of my projects in Visual Studio 2008. On the "Service Reference Settings" screen I am selecting the default option which says "Reuse types in all referenced assemblies". I have referenced the project for which I want to reuse a type. That type is being passed in as a parameter to a web method.

然而,在生成References.cs文件时,它仍然会创建该类型的重复代理版本。有我丢失的东西?你需要做什么特别的引用类型?也许添加一些特殊的属性?

However, when the References.cs file is generated, it still creates a duplicate proxy version of that type. Is there something I am missing? Do you need to do anything special to the referenced type? Perhaps add some special attributes?

推荐答案

我已经回答了我的问题(我认为)。我试图做的是使用服务引用指向一个现有的ASP.NET Web服务,但重用类型不支持老同学Web服务。它仅适用于WCF服务。所以我采取了暴跌,并转换我的网络服务,以一个真正的WCF服务,现在它工作正常。

I've answered my own question (I think). What I was trying to do was use a service reference to point to an existing ASP.NET web service, but reusing types is not supported for old school web services. It only works with WCF services. So I took the plunge and converted my web service to a true WCF service and now it works fine.

这篇关于"重用现有的类型和QUOT;添加服务引用时被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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