Trying to host my webapi on the production machine but there, all DI services remains null. And I get the NullReferenceException
everywhere I try to access the services
variable inside the Startup
class.
The exception points the line where I'm adding the context. services.AddDbContext(x=>x.UseMySql(...))
. If I remove this line, then It jumps to the services.AddAutoMapper()
and so on.
Note that this occurs only on the production machine. Everything is pretty cool on my dev machine.
Am I missing a config file (appsetting.json
and appsetting.dev.json
are both identicall) OR is there another cause?