I have a problem when referencing a Standart2.0 project in my api .net Framework 461;
The following happens I have the class:
public class MeuReturn : IHttpActionResult
{
private readonly string _objeto;
public MeuReturn(string objeto)
{
_objeto = objeto;
}
public Task<HttpResponseMessage> ExecuteAsync(CancellationToken cancellationToken)
{
HttpResponseMessage response =
new HttpResponseMessage(HttpStatusCode.BadRequest)
{
Content = new StringContent(_objeto)
};
return Task.FromResult(response);
}
}
To perform a custom return, 100% works, but when I refer to the other project and squeeze the API, the following error occurs:
An error occurred. Method ExecuteAsync in WebApplication3.Controllers.MuReturn type of assembly WebApplication3, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null does not have an implementation. System.TypeLoadException in WebApplication3.Controllers.HomeController.erro () in lambda_method (Closure, Object, Object []) in System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.