错误消费时服务:类型名称'AAA'不在类型“YYY.YYY”存在 [英] Error when consuming service : The type name ‘AAA' does not exist in the type ‘YYY.YYY’

查看:403
本文介绍了错误消费时服务:类型名称'AAA'不在类型“YYY.YYY”存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图消耗WCF 4.0服务在我的应用程序。我构建,测试,并从根本上部署服务。该服务工作在WCF测试客户端,并可以在任何其他的测试项目中,我建消耗。问题是这样的一个特定的应用程序......唯一一个重要的,因为它是我建立了服务的原因。

I'm trying to consume a WCF 4.0 service in my application. I built, tested, and deployed the service from the ground up. The service works in the WCF test client and can be consumed in any other test project I built. The problem is this one particular application... the only one that matters as it's the reason I built the service.

在我引用的售后服务打造的应用程序,我得到一个错误。误差是

When I build the application after referencing the service I get an error. The error is "The type name 'AAA' does not exist in the type 'YYY.YYY' ".

项目消费该服务被命名为'YYY.Web',是在YYY'命名空间。

The project consuming the service is named 'YYY.Web' and is in the 'YYY' namespace.

该服务在YYY.ReportingService'命名空间最初创建。它已被改变为不同的命名空间一旦这个问题开始。现在在MMM的命名空间。

The service was initially created in the 'YYY.ReportingService' namespace. It has been changed to a different namespace once this problem started. Is now in the 'MMM' namespace.

我添加了一个使用指令YYY.Service1。我也尝试走样用指令(使用测试= YYY.Service1)

I added a using directive 'YYY.Service1'. I also tried aliasing the using directive (using test = YYY.Service1)

要确保事情不搞砸了我的服务,它的命名空间,我建立了一个新的服务以单一的方法。它需要一个字符串参数,并返回你好,和任何字符串传递。该服务也适用于WCF测试客户端和几个测试项目,我创建的。这项服务是在SimpleTestService命名空间,BasicService类,有一个名为GetGreeting methiod。命名是有意这样做,以避免任何可能的命名冲突。该错误仍然出现这个新的服务。

To make sure something wasn't messed up with my service and its namespaces, I built a new service with a single method. It takes a string parameter and returns "Hello, " and whatever string is passed. This services also works in the WCF test client and the couple of test projects I created. This service is in the SimpleTestService namespace, BasicService class, with a methiod named GetGreeting. Naming was done intentionally to avoid any possible naming collisions. The error still occurs with this new service.

在这个有什么想法?谢谢!

Any thoughts on this? Thanks!

推荐答案

这一次我花了一段时间。原来,那的类型名称'AAA'不类型存在'YYY.YYY'是由YYY.YYY造成的 - 我的消费类共享名其含有的命名空间。

This one took me a while. Turned out, that "The type name 'AAA' does not exist in the type 'YYY.YYY' " was caused by the YYY.YYY - my consuming class sharing name with its containing namespace.

解决方法:重命名消费类,即 YYY.XXX

Solution: rename the consuming class, i.e. YYY.XXX.

这篇关于错误消费时服务:类型名称'AAA'不在类型“YYY.YYY”存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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