Method not found: 'System.Web.Http.ApiController.get_Request()'

method not found java
method not found exception java
method not found error code
method not found get_property
method not found error java
method not found: 'void
method not found: 'system string
method not found: 'int32

I have an Azure web app, and when calling a Web API Controller Post method I've been getting the following exception:

Method not found: 'System.Net.Http.HttpRequestMessageSystem.Web.Http.ApiController.get_Request()'

I can't reproduce this error when running the app locally, it only happens on Azure.

Here is the controller's code:

using System;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using TFL.BL;
using TFL.BO;
using TFL.Web.DTO;

namespace TFL.WebAPI.Controllers
{
    public class SearchController : ApiController
    {
        public HttpResponseMessage Get() 
        {
            return Request.CreateResponse(200);
        }
        // POST: api/Search
        public HttpResponseMessage Post([FromBody]SearchDTO dto)
        {
            Search s = new Search();
            s.FirstName = dto.FirstName;
            s.LastName = dto.LastName;
            s.Email = dto.Email;
            s.BirthDate = dto.BirthDate;
            s.City = dto.City;
            s.Country = dto.Country;
            s.FromAge = Convert.ToInt32(dto.FromAge);
            s.Gender = Convert.ToInt32(dto.Gender);
            s.ImagePath = dto.ImagePath;
            s.PageNumber = Convert.ToInt32(dto.PageNumber);
            s.PathUrl = dto.PathUrl;
            s.ProfessionID = Convert.ToInt32(dto.ProfessionID);

            s.State = dto.State;
            s.Str = dto.Str;
            s.Tags = null;
            s.ToAge = Convert.ToInt32(dto.ToAge);
            s.TypeID = Convert.ToInt32(dto.TypeID);
            s.Culture = dto.Culture;

            return Request.CreateResponse(HttpStatusCode.Accepted, SearchBL.GetList(s));
        }

        // PUT: api/Search/5
        public void Put(int id, [FromBody]string value)
        {
        }

        // DELETE: api/Search/5
        public void Delete(int id)
        {
        }
    }
}

Stack trace:

at TFL.WebAPI.Controllers.SearchController.Post(SearchDTO dto)
↵   at lambda_method(Closure , Object , Object[] )
↵   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)
↵   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)
↵   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)
↵--- End of stack trace from previous location where exception was thrown ---
↵   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
↵   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
↵   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()
↵--- End of stack trace from previous location where exception was thrown ---
↵   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
↵   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
↵   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()
↵--- End of stack trace from previous location where exception was thrown ---
↵   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
↵   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
↵   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()

I can't reproduce this error when running the app locally, it only happens on Appreciate any help given!

I tested your code on my side and it worked well on my Azure Web App. Since it worked well on your development machine, please check following option to remove the additional files before publish.

System.MissingMethodException: Method not found?, Solved: Using the V2 API wrapper for C#. I am getting the following while doing AddContact Method not found: 'System.Collections.Generic.List`1. The 405 Method Not Allowed is an HTTP response status code indicating that the specified request HTTP method was received and recognized by the server, but the server has rejected that particular method for the requested resource. This message is distinctly different from the 404 Not Found code that we looked at a while back.

I managed to solve this issue by changing the return type of my web API functions to actual objects, rather then HttpResponseMessages. Works like a charm.

Solved: Getting Method Not Found for Methon get_EmailAddre , class in a project and the caller is in another project..both c#. Both projects compile during execution/debugging the "Method not found" exception is raised! I think this is caused because you have updated SDL Studio 2017- but not MultiTerm. Both Studio and MultiTerm must always be up-to date and on the latest versions. As you are unable to use the AutoUpdate feature in MultiTerm, please navigate to the following folder-

I had a similar problem recently. I had to change

return ResponseMessage(Request.CreateResponse(HttpStatusCode.BadRequest, new Error(ModelState, 0)));

to

return BadRequest(ModelState);

I still don't know WHY the previous code (which is working in other API projects) messes up here, but this was the fix for me.

Re: C# Exception : Method not found, that is thrown when there is an attempt to dynamically access a method that does not exist. Unable to access the AField field: Field 'App.AField' not found. Export failed: Method not found: 'CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag CrystalDecisions.ReportAppServer.ReportDefModel.ISCRExportOptions.get_ExportOptionsEx()' Cause. This problem occurs if the Crystal Reports runtime software used by Report Commander has been corrupted or failed to install properly. Resolution

I managed to solve this by returning an actual object, rather than an HttpResponseMessage.

MissingMethodException Class (System), The requested resource could not be found but may be available in the future. Subsequent requests by the client are permissible. 405 Method Not Allowed: A� Compile error: Method or data member not found I'm using three List Boxes on one sheet (the Font Book tab), where clicking one deselects the other two. The worksheet functions as expected, but on opening the workbook, I receive the "Compile error" popup.

I added this to the web.config file and was sorted

<dependentAssembly>
    <assemblyIdentity name="System.Net.Http" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" />
    <bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
 </dependentAssembly>

MissingMethodException: Method not found: System.Net.Http , hi, i have a problem with defining methods. I define method but when i try to call it , i get message “Warning: Method 'createPlane()' not found”. does anyone have� Sets the FileProvider for file-based providers to a PhysicalFileProvider with the base path.

List of HTTP status codes, 7.0 of "Abp" Nuget package. Build and run. Unfortunately I get a missing method exception: System.MissingMethodException: Method not found: '� Console.WriteLine("Unable to access the AnotherField field: {0}", e.Message) End Try End Sub End Class ' This code example produces the following output: ' ' Unable to call the DoSomething method: Method 'App.DoSomething' not found. ' Unable to access the AField field: Field 'App.AField' not found.

Method not found - DesignScript - Dynamo,

MissingMethodException: Method not found,

Comments
  • can you add the stack trace?
  • Sounds like your System.Web.Http.dll isn't being copied from local and the one on Azure is outdated. Make sure that the reference is copied and deployed with the rest of your app.
  • What does your API call on the client-side look like?
  • something along the lines of this.http.post(dto)
  • Have you checked whether your GET method of API is worked or not?
  • I'm actually dragging the DLLs manually to the on-premise bin folder on the kudu SCM console, since I'm having problems simultaneously deploying from GitHub (for my client side angular code) and from Visual Studio (for my service side C# code). Whenever I want to deploy I manually clear the Azure bin folder and copy the files there.
  • Please also copy the web.config to your azure web app during publish.
  • Please also check whether the URL which you used to request the API is right. It looks like the request hasn't been handled by your Search API. Please also check whether DLL modified date, is it equals to the DLL file at local?
  • How do you communicate when something went wrong, e.g. if there are Modelstate errors?
  • <dependentAssembly> <assemblyIdentity name="System.Net.Http" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" /> <bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" /> </dependentAssembly>
  • Edit your answer and include your comment in your answer.