c# - 将 CRM 代理类生成为单独的文件

标签 c# proxy dynamics-crm-2011 dynamics-crm-4

我一直在使用引用 Dynamics CRM 租户的旧程序集。该程序集包含(除其他外)租户的代理类。我需要将代理类更新到最新版本。

我过去曾使用 crmsvcutil.exe 为租户生成代理类文件,但在这个程序集中,每个类都在自己单独的文件中。例如,有一个“person”c-sharp 文件,其中包含 person 实体的变量和 get/set 方法。

当前文件格式如下:

using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Xml.Serialization;
namespace CRM2011.Proxy.Organisation
{
    [GeneratedCode("System.Xml", "4.0.30319.1"), DesignerCategory("code"), DebuggerStepThrough, XmlType(Namespace = "http://schemas.microsoft.com/crm/2007/WebServices")]
    [Serializable]
public class thr_offer : BusinessEntity
{
    private Lookup createdbyField;
    private CrmDateTime createdonField;
    //More variables here
    public Lookup createdby
    {
        get
        {
            return this.createdbyField;
        }
        set
        {
            this.createdbyField = value;
        }
    }
    public CrmDateTime createdon
    {
        get
        {
            return this.createdonField;
        }
        set
        {
            this.createdonField = value;
        }
    }
    //More get/set methods here
}

这些似乎是由工具生成的,但我不知道有任何工具可以执行此操作。如果我可以生成诸如此类的文件,而不是 crmsvcutil.exe 生成的庞大文件,这将使开发变得更加容易。

有什么想法吗?

最佳答案

文件是使用 CRM 4.0 SDK 生成的(CrmDateTime 响铃)。

使用 CRM 4.0 SDK 中的 CrmSvcUtil.exe 可以生成单独的文件,如下所述:

http://msdn.microsoft.com/en-us/library/ff681563.aspx

/out parameter

Determines the name of the .cs or .xml output file and whether there is one file or one per entity. It may include a full path. If you specify a name that does not end with .cs or .xml, CrmSvcUtil will write an individual .cs file for every entity in the system to the folder you specify. For example, /out:MyClasses outputs a class file (.cs) for every entity to a folder called MyClasses.However, /out:MyClasses.cs outputs a class file (MyClasses.cs) that contains all entities.

此“功能”已从 CRM 2011 SDK 中删除(如果您尝试指定不带文件扩展名的名称,它仍会生成单个文件)

关于c# - 将 CRM 代理类生成为单独的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21544495/

相关文章:

c# - MS Dynamics CRM 2011 SDK - 使用后期绑定(bind)更新实体记录

c# - 使用 C# ASP.NET 3.5 System.Net.Mail 发送大附件

c# - 查找字典中奇数/偶数的数量

c# - 在 C# 中使用 File.Copy() 时“设备未准备好”

linux - Ubuntu 16.04 apt-get - 无法解析 'proxy_server'

dynamics-crm-2011 - 以其他用户身份登录失败

jquery - 尝试通过 JQuery ajax 从 Microsoft CRM 2011 REST 端点检索数据时出现 TypeError

c# - 在 C# 中使用 AUDIO 分析 WAV 文件中的数据 block

python - 由于 ssl 错误,无法使用 urllib 连接到 https 站点

proxy - 使用Powershell和代理访问Web