gpt4 book ai didi

c# - 无法通过 C# 代码访问 MS CRM Dynamic 365

转载 作者:行者123 更新时间:2023-11-30 21:36:23 25 4
gpt4 key购买 nike

我在尝试连接到 MS CRM v9 时遇到问题

我使用此代码进行连接:

Uri organizationUri = new Uri(OrgUrl);
AuthenticationCredentials authCredentials = new AuthenticationCredentials();
authCredentials.ClientCredentials.UserName.UserName = UserName;
authCredentials.ClientCredentials.UserName.Password = Password;
OrganizationServiceProxy organizationProxy = new OrganizationServiceProxy(organizationUri, null, authCredentials.ClientCredentials, null);
organizationProxy.EnableProxyTypes();`
var _service = organizationProxy;

这是异常信息

HResult=-2146233079 Message=Metadata contains a reference that cannot be resolved: 'https://myOrg.api.crm4.dynamics.com/XRMServices/2011/Organization.svc?wsdl&sdkversion=9'. InnerException: HResult=-2146233079 Message=The underlying connection was closed: An unexpected error occurred on a send. InnerException: HResult=-2146232800 Message=Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. InnerException: ErrorCode=10054 HResult=-2147467259 Message=An existing connection was forcibly closed by the remote host

有没有人遇到过这个问题。 PS:这段代码之前在同一个项目中运行

最佳答案

看来您需要将 SDK 引用更新为新的 9.0 SDK 引用。 SDK 不再需要单独下载,您必须使用 NuGet ( https://blogs.msdn.microsoft.com/crm/2017/11/01/whats-new-for-customer-engagement-developer-documentation-in-version-9-0/ )

No more monolithic SDK download Probably the greatest single change is that we are no longer providing a single download package for all the documentation, tools and sample code. Going forward, instead of shipping a single package with everything in it, we will offer an a-la-carte approach so that you can download the individual things as you need them.

Get the assemblies and tools you need. SDK assemblies and tools will be distributed only via NuGet. We will provide a script that will allow you to download the assemblies and tools from NuGet. See Where to find the NuGet SDK packages and Download tools from NuGet.

Self-serve offline content generation. The new learn.microsoft.com site will allow you to download a PDF for any of our content areas so that you can read and search the documentation while offline.

Sample code availability. All our sample code will be available on msdn.microsoft.com or on GitHub. The code.msdn.microsoft.com site is designed for sample code and provides a good experience as well as providing us better metrics on usage.

Download only the pieces you need. Various assets we have included in the download package will be available as individual downloads. This way, if one of the assets needs to be updated we can just update it without releasing the entire SDK package.

https://www.nuget.org/profiles/crmsdk有您可能需要的所有 SDK DLL 的列表。具体https://www.nuget.org/packages/Microsoft.CrmSdk.XrmTooling.CoreAssembly/包括我认为您实际需要的连接器。

您可以在 NuGet 控制台中使用以下命令将其添加到您的项目中

Install-Package Microsoft.CrmSdk.XrmTooling.CoreAssembly -Version 9.0.0.7

如果你不需要特定的版本,你可以使用

Install-Package Microsoft.CrmSdk.XrmTooling.CoreAssembly

关于c# - 无法通过 C# 代码访问 MS CRM Dynamic 365,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48279259/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com