4

I'm currently upgrading a 2011 environment to 2016SP1 (on-prem).

One external application which used Xrm.Client is being upgraded to Xrm.Tooling.Connector but I'm at a loss about this piece of code

ObjectCache cache = Microsoft.Xrm.Client.Caching.ObjectCacheManager.GetInstance();
cache.Clear();

What's the equivalent now that Xrm.Client is gone ?

To clarify: as far as I understand, the purpose of that is to make sure the application does not cache data. I'd be happy with a non-equivalent piece of code that allows me to tell the SDK "whatever you happen to be caching, invalidate it"

Alex
  • 23,004
  • 4
  • 39
  • 73
  • This isn't quite an answer so I'll comment instead... I'm not sure why they didn't carry this across to the Tooling kit. But it looks like you have 1 of 2 options. You can get this DLL as part of the 2015 SDK and as far as I'm aware it should still work for you. But I'm not sure how nicely that plays alongside the tooling kit, or even how feasible that will be. The other option is write your own cache manager. It's just a `MemoryCache` under the hood anyway, just with a shed load of Microsoft code wrapping it in Object Cache Managers and Providers etc etc. – Conor Gallagher Mar 09 '17 at 22:07
  • I'm not very familiar with the whole managing the cache (never tackled the issue), if an equivalent isn't available I'd consider a workable code sample an acceptance-worthy answer. – Alex Mar 10 '17 at 08:44
  • Ah, ok, that makes things a bit different. I thought you wanted a replacement for the caching in general with the ability to clear it, not just specifically for the part about clearing the cache. I'm not sure how this works with 365, have been already looking into it a little, but haven't come across anything concrete. Out of interest, are you using IServiceManagement to set up your organization service proxy? I could be wrong, but I think that's where the caching come's into play in 365. I don't have an environment available to play around with for a concrete answer just at this moment. – Conor Gallagher Mar 13 '17 at 11:11

0 Answers0