Pregunta

Tengo problemas con el almacenamiento en caché de CRM 2011. No lo necesito, pero no sé cómo deshabilitarlo.

Primero genero esto:

Crmsvcutil.exe /codeCustomization:"microsoft.xrm.client.codeGeneration.codeCustomization, microsoft.xrm.client.codeGeneration "/out: outputcs /url:htps://crmaddress/xrmservices/2011/organization.svc/username: usr/usr/ Contraseña: PW /espacio de nombres: NS /ServiceContextName: xrmserviceContext

Entonces tengo el siguiente código:

   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();
    }

¿Qué debo hacer para apagar el almacenamiento en caché?

¿Fue útil?

Solución

Especifique el servicio en su archivo de configuración:

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

Otros consejos

Otro bypass que encontré que se puede usar, no es perfecto y la gente podría darme malas críticas.

Pero siempre puede usar una consulta que siempre cambia con un número aleatorio u otro código aleatorio:

Random r = new Random();
int rInt = r.Next(-100000000, 100000000);
var l = _crmService.EntitySet.where(m => m.name == "a" &&  m.name!=rInt.ToString()).ToList();
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top