Search code examples
c#nugetdynamics-crmmicrosoft-dynamicsdynamics-crm-2016

cannot instantiate Xrm.Utility


I'm trying to access Xrm.Utility from my C# Web Application. I've downloaded Microsoft.CrmSdk packages from NuGet, and have these references at the top of my C# code:

using Microsoft.Crm.Sdk;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Client;
using Microsoft.Xrm.Tooling;

Unfortunately, in my code I cannot see Utility anywhere. When use intellisense to help, I do see the references to the ones I've references (please see attached screenshot).

enter image description here

How can I get Microsoft.Xrm.Utility? I've searched NuGet and cannot find it.

Btw, these are the functions I'm needing - https://learn.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/xrm-utility


Solution

  • Xrm.Utility (Client API reference) - as the name suggests this is Client API method, used in javascript for Form scripting. Simply you can use it in web resource.

    That being said, you cannot use (expect) that in C# server side coding like console app or CRM Plugin development.