Home

Why does this work sometime and not others?

edited February 2021

The following code works in Linqpad half the time but when executed in a VS Console it always runs.

void Main()
{
    string connectionString = "Url=****; AuthType=IFD;";
    IOrganizationService service = (IOrganizationService)new Microsoft.Xrm.Tooling.Connector.CrmServiceClient(connectionString);
    Console.WriteLine(service.Execute(new WhoAmIRequest()));
}

It creates connection to a Dynamics CRM instance and then request information about who the calling user is.

Sometimes it will work by copying and pasting into another tab. It will run in the new tab but not the old one.

Most of the times it just won't work.

I'm using LinqPad 5 (Pro Edition) v5.43.00 (AnyCPU)

Any help appreciated!

Comments

  • Define "it just won't work" - is the program not responding? Is there unexpected output? Is there no output? An exception thrown?

    Perhaps something is cached in the application domain - you can refresh (unload) the domain by pressing SHIFT-F5 ("Query Process Unloaded" should appear in status bar)

Sign In or Register to comment.