【问题标题】:How to disable CRM 2011 Xrm caching?如何禁用 CRM 2011 Xrm 缓存?
【发布时间】:2012-01-08 16:48:33
【问题描述】:

我的 crm 2011 缓存有问题。我不需要它,但我不知道如何禁用它。

首先我生成这个:

CrmSvcUtil.exe /codeCustomization:"Microsoft.Xrm.Client.CodeGeneration.CodeCustomization, Microsoft.Xrm.Client.CodeGeneration" /out:Outputcs /url:https://crmaddress/XRMServices/2011/Organization.svc /用户名:usr/密码:pw /namespace:ns/serviceContextName:XrmServiceContext

然后我有以下代码:

   private XrmServiceContext _crmService;

    public CrmWS()
    {
        CrmConnection _connection = new CrmConnection();
        _connection.ServiceUri = new Uri("https://url");

        ClientCredentials credentials = new ClientCredentials();
        credentials.Windows.ClientCredential = new NetworkCredential("1","2","3"); 
        _connection.ClientCredentials = credentials;
        _connection.ClientCredentials.UserName.UserName = "1";
        _connection.ClientCredentials.UserName.Password = "2";
        _crmService = new XrmServiceContext(_connection);

       var l = _crmService.EntitySet.where(m => m.name == "a").ToList();
    }

我应该怎么做才能关闭缓存?

【问题讨论】:

    标签: caching dynamics-crm-2011 crm xrm


    【解决方案1】:

    在配置文件中指定服务:

      <microsoft.xrm.client>   
        <services>
          <add name="Xrm" type="Microsoft.Xrm.Client.Services.OrganizationService, Microsoft.Xrm.Client"/>
        </services>
      </microsoft.xrm.client>
    

    【讨论】:

      【解决方案2】:

      我发现的另一个可以使用的绕过方法,它并不完美,人们可能会给我差评。

      但您始终可以使用始终随随机数或其他随机代码变化的查询:

      Random r = new Random();
      int rInt = r.Next(-100000000, 100000000);
      var l = _crmService.EntitySet.where(m => m.name == "a" &&  m.name!=rInt.ToString()).ToList();
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-08-05
        • 1970-01-01
        • 2013-12-12
        • 1970-01-01
        • 2014-07-31
        • 2011-07-26
        相关资源
        最近更新 更多