【问题标题】:VS2015 The type name does not exist in the typeVS2015 类型中不存在类型名称
【发布时间】:2015-09-10 11:29:29
【问题描述】:

我遇到以下情况:WCF 服务正在运行,并通过使用“添加服务引用”生成客户端代码。

namespace Delivery.PublishingService {

  [System.ServiceModel.ServiceContractAttribute(ConfigurationName="PublishingService.IPublish", CallbackContract=typeof(Delivery.PublishingService.IPublishCallback))]
  public interface IPublish {}

它像往常一样生成命名空间 Delivery.PublishingService,然后这些类型被完全限定的名称引用,例如“Delivery.PublishingService.IPublishCallback”。

但 Visual Studio 2015 会抛出错误: “Delivery”类型中不存在类型名称“PublishingService”

但正如您在上面看到的,代码已经命名空间内。这应该真的编译。 这是 VS 2015 中的错误还是我在这里遗漏了什么?

【问题讨论】:

  • 您能否发布您正在使用的导致此错误的代码?
  • 有没有机会在你的项目中有一个名为“delivery”的课程?

标签: c# .net visual-studio wcf visual-studio-2013


【解决方案1】:

最后通过简单地使用另一个名称来修复它。不知何故,即使项目中从未使用过 Delivery 这个名称,也无法使用它。但它是解决方案中另一个项目中的一个类,也许这就是问题所在

【讨论】:

    猜你喜欢
    • 2013-08-05
    • 1970-01-01
    • 2020-03-31
    • 1970-01-01
    • 2020-03-05
    • 2010-12-04
    • 1970-01-01
    • 1970-01-01
    • 2022-01-10
    相关资源
    最近更新 更多