当我尝试在Visual Studio中将其添加为Organization Service
时,我无法访问Service Reference
。但是,我可以在浏览器中访问该服务。我尝试添加OrganizationData
服务,但没有问题。
An Error occurred while attempting to find service at 'http://xxxxxxxx/xxxxx/XRMServices/2011/Organization.svc'.
错误详情
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.
答案 0 :(得分:1)
我会引用SDK程序集(Microsoft.Xrm.Sdk.dll, Microsoft.Crm.Sdk.Proxy.dll, Microsoft.Xrm.Client.dll
)与添加服务引用。它们为OrganizationService
提供了非常干净的代理对象,并大大简化了CrmConnection
类的身份验证。 Here是一个示例。
您可以在MSFT Download Center和NuGet上找到它们,只需确保使用与您的CRM版本相匹配的版本,包括UR。