Hi,
I am using PowerApps-Samples Code from https://github.com/microsoft/PowerApps-Samples/tree/master/cds but i am getting error with
Severity Code Description Project File Line Suppression State Error CS1061 'HttpRequestMessage' does not contain a definition for 'Clone' and no accessible extension method 'Clone' accepting a first argument of type 'HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?) Dynamics Webapi C:\Users\lenova\source\repos\Dynamics Webapi\Dynamics Webapi\CDSWebApiService.cs 469 Active
i am using this file path Dynamics Webapi\Dynamics Webapi\CDSWebApiService.cs
The code as below
private async Task SendAsync( HttpRequestMessage request, HttpCompletionOption httpCompletionOption = HttpCompletionOption.ResponseHeadersRead, int retryCount = 0) { HttpResponseMessage response; try { //The request is cloned so it can be sent again. response = await httpClient.SendAsync(request.Clone(), httpCompletionOption); } catch (Exception) { throw; } if (!response.IsSuccessStatusCode) { if ((int)response.StatusCode != 429) { //Not a service protection limit error throw ParseError(response); } else { // Give up re-trying if exceeding the maxRetries if ( retryCount >= config.MaxRetries) { throw ParseError(response); } int seconds; //Try to use the Retry-After header value if it is returned. if (response.Headers.Contains("Retry-After")) { seconds = int.Parse(response.Headers.GetValues("Retry-After").FirstOrDefault()); } else { //Otherwise, use an exponential backoff strategy seconds = (int)Math.Pow(2, retryCount); } Thread.Sleep(TimeSpan.FromSeconds(seconds)); return await SendAsync(request, httpCompletionOption, retryCount); } } else { return response; } }
Any help would be appreciated.thank you
Hello,
I fix that error by uninstalling Newtonsoft.json and then installig again.
Right click on Project->Manage Nuget packages->Uninstall Newtonsoft.json->Install Newtonsoft.json
->Build your solution
Make sure you have cloned entire project from github. Also, Update your .net framework to use 4.7.2
Hi,
I am using following Reference let me know if i am missing any reference
In code we are using
Framework i am using following screen
Hi Rocky,
The CS1061 error is caused when you try to call a method or access a class member that does not exist
Maybe you are missing an assembly reference?
André Arnaud de Cal...
292,162
Super User 2025 Season 1
Martin Dráb
230,962
Most Valuable Professional
nmaenpaa
101,156