无法将CRM 2011的组织服务添加为VS项目的服务参考

时间:2014-05-27 15:21:43

标签: visual-studio-2010 wcf dynamics-crm-2011 dynamics-crm service-reference

当我尝试在Visual Studio中将其添加为Organization Service时,我无法访问Service Reference。但是,我可以在浏览器中访问该服务。我尝试添加OrganizationData服务,但没有问题。

An Error occurred while attempting to find service at 'http://xxxxxxxx/xxxxx/XRMServices/2011/Organization.svc'.

enter image description here

错误详情

There was an error downloading 'http://xxxxxxxx/xxxxx/XRMServices/2011/Organization.svc/_vti_bin/ListData.svc/$metadata'.
The request failed with HTTP status 400: Bad Request.
Metadata contains a reference that cannot be resolved: 'http://xxxxxxxx/xxxxx/XRMServices/2011/Organization.svc'.
Metadata contains a reference that cannot be resolved: 'http://xxxxxxxx/xxxxx/XRMServices/2011/Organization.svc'.
If the service is defined in the current solution, try building the solution and adding the service reference again.

1 个答案:

答案 0 :(得分:1)

我会引用SDK程序集(Microsoft.Xrm.Sdk.dll, Microsoft.Crm.Sdk.Proxy.dll, Microsoft.Xrm.Client.dll)与添加服务引用。它们为OrganizationService提供了非常干净的代理对象,并大大简化了CrmConnection类的身份验证。 Here是一个示例。

您可以在MSFT Download CenterNuGet上找到它们,只需确保使用与您的CRM版本相匹配的版本,包括UR。