CrmSvcUtil 仅创建 OrganizationServiceContext 派生体(应为 CrmOrganizationServiceContext)

发布于 2024-12-28 17:33:08 字数 869 浏览 0 评论 0原文

我以这种方式使用 CrmSvUtil:

crmsvcutil.exe /url:http://crm2011/MyTestOrg/XRMServices/2011/Organization.svc /out:GeneratedCode.cs /namespace:Xrm /serviceContextName:XrmDataContext

输出包含数千个业务对象和这个上下文类:

[System.CodeDom.Compiler.GeneratedCodeAttribute("CrmSvcUtil", "5.0.9688.1533")]
public partial class XrmDataContext : Microsoft.Xrm.Sdk.Client.OrganizationServiceContext

但是查看示例(即 .\sdk\walkthroughs\portal\consoleappwalkthrough) 我清楚地可以看到应该派生上下文类来自 OrganizationServiceContext 的更强大的子类 -> CrmOrganizationServiceContext:

[System.CodeDom.Compiler.GeneratedCodeAttribute("CrmSvcUtil", "5.0.9688.583")]
public partial class XrmServiceContext : Microsoft.Xrm.Client.CrmOrganizationServiceContext

我绝对需要 CrmOrganizationServiceContext,因为只有这样我才有我需要的构造函数。那么我做错了什么或者我错过了哪个设置?

I'm using CrmSvUtil this way:

crmsvcutil.exe /url:http://crm2011/MyTestOrg/XRMServices/2011/Organization.svc /out:GeneratedCode.cs /namespace:Xrm /serviceContextName:XrmDataContext

And the output contains thousands of business objects and this context class:

[System.CodeDom.Compiler.GeneratedCodeAttribute("CrmSvcUtil", "5.0.9688.1533")]
public partial class XrmDataContext : Microsoft.Xrm.Sdk.Client.OrganizationServiceContext

But looking at the samples (namely .\sdk\walkthroughs\portal\consoleappwalkthrough) I clearly can see there that the context class should be derived from a more mighty sub class of OrganizationServiceContext -> CrmOrganizationServiceContext:

[System.CodeDom.Compiler.GeneratedCodeAttribute("CrmSvcUtil", "5.0.9688.583")]
public partial class XrmServiceContext : Microsoft.Xrm.Client.CrmOrganizationServiceContext

I definitely need CrmOrganizationServiceContext because only then I have the constructors I need. So what I'm doing wrong or which setting did I miss?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

毁梦 2025-01-04 17:33:08

查看该 SDK 示例的网络版本中给出的参数。他们将生成您正在寻找的课程。

CrmSvcUtil.exe /codeCustomization:"Microsoft.Xrm.Client.CodeGeneration.CodeCustomization, Microsoft.Xrm.Client.CodeGeneration" /out:Xrm\Xrm.cs /url:http://Crm/Contoso/XRMServices/2011/Organization.svc /domain:CONTOSO /username:administrator /password:pass@word1 /namespace:Xrm /serviceContextName:XrmServiceContext

Check out the parameters given @ the web version of that SDK sample. They will generate the class you're looking for.

CrmSvcUtil.exe /codeCustomization:"Microsoft.Xrm.Client.CodeGeneration.CodeCustomization, Microsoft.Xrm.Client.CodeGeneration" /out:Xrm\Xrm.cs /url:http://Crm/Contoso/XRMServices/2011/Organization.svc /domain:CONTOSO /username:administrator /password:pass@word1 /namespace:Xrm /serviceContextName:XrmServiceContext
ゞ记忆︶ㄣ 2025-01-04 17:33:08

使用早期绑定生成器,并选中“使用 Xrm 客户端”复选框。它将使用您期望的基类生成上下文。

Use the Early Bound Generator, and select check the check box "Use Xrm Client". It'll generate the Context with the base class you're expecting.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文