更新服务参考后,项目无法生成 [英] Project does not build after updating a service reference

查看:40
本文介绍了更新服务参考后,项目无法生成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新服务参考后,构建项目时出现以下错误:

不包含'DefaultResolveType'的定义

在自动生成的Reference.cs上引发了错误,但是DefaultResolveType方法应该在从"this"关键字调用的生成类中.自上次成功构建以来,数据服务没有更改,客户端代码也没有更改.

  [global :: System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design","1.0.0")]受保护的全局:: System.Type ResolveTypeFromName(string typeName){全局:: System.Type解析类型= this.DefaultResolveType(typeName,"Microsoft.Crm.Sdk.Data.Services","ITF.DataAccessLayer.CRM.CrmAccessService");如果((resolvedType!= null)){返回resolveType;}返回null;} 

解决方案

好的.

  • 右键单击项目
  • 点击管理NuGet软件包"
  • 卸载WCF数据服务客户端(已安装5.6版),它将删除其他相关程序包
  • 通过单击左侧的在线选项卡重新启用WCF数据服务客户端(5.6.1)

该软件包的5.6版本似乎有问题

I get the following error building my project after updating a service reference:

does not contain a definition for 'DefaultResolveType'

The error is thrown on the auto-generated Reference.cs, but the DefaultResolveType method should be in the generated class as it is called from the 'this' keyword. The data service hasn't changed and the client code hasn't changed since the last successful build.

[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")]

protected global::System.Type ResolveTypeFromName(string typeName)
{
    global::System.Type resolvedType = this.DefaultResolveType(typeName, "Microsoft.Crm.Sdk.Data.Services", "ITF.DataAccessLayer.CRM.CrmAccessService");
    if ((resolvedType != null))
    {
        return resolvedType;
    }

    return null;
 }

解决方案

OK.. I've figured out how to fix this:

  • Right-click on the project
  • Click 'Manage NuGet Packages'
  • Uninstall WCF Data Services Client (version 5.6 was installed), it will remove other dependant packages
  • Resinatall the WCF Data Service Client (5.6.1) through clicking the online tab on the left

Seems like there is a problem with version 5.6 of this package

这篇关于更新服务参考后,项目无法生成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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