1
I’m getting this error after giving deploy(AWS)
of my WebApi
.
Note: PLACE WORKS PERFECTLY.
<ExceptionMessage> An error occurred when trying to create a controller of type 'LivroController'. Make sure that the controller has a parameterless public constructor. </ExceptionMessage>
Man controller
:
public class LivroController : BaseODataController<Livro>
{
public LivroController() : base()
{}
}
My Base OdataController
:
public class BaseODataController<TEntity> : ODataController,
IBaseController<TEntity> where TEntity : class
{
private readonly IRepositoryBase<TEntity> Repository;
public BaseODataController()
{
Repository = new RepositoryBase<TEntity>();
}
[EnableQuery]
public IList<TEntity> Get()
{
return Repository.Get().ToList();
}
}
I already put an empty constructor in LivroController
, but it remains the same error.
Already compared whether the local. net and AWS versions are identical?
– DiegoSantos
Yes, I took the local tests and I went up myself.
– Vinicius
Works perfectly locally published? Or works perfectly in DEBUG?
– Gabriel Coletta
works perfectly when I am debugging, when I send to the server error happens
– Vinicius
Tries to make a builder for Livrocontroller by calling the base:
public LivroController() : base () {}
– Gabriel Coletta
did not work @Gabrielcoletta, I also edited the question with the constructor, and includes an image with all the error.
– Vinicius
@Vinicius Leia at all times to Inner Exception more existing internal. See that the error says: "The Provider for invariant name Mysql.Data.Mysqlclient is specified Multiple times [...]"
– Jéf Bueno
@LINQ thanks for the tip and the response here
– Vinicius