问题
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;
}
回答1:
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
来源:https://stackoverflow.com/questions/24082564/project-does-not-build-after-updating-a-service-reference