Hello,
I just created a new MVC application. I'm using it to test out StructureMap.
So far in my Startup.cs file, I have this:
public class Startup
{
...
public void Configure(...)
{
...
var container = new StructureMap.Container(c =>
{
c.For<IService>().Use<Service>();
});
}
}
And in my HomeController, I have this:
public class HomeController
{
private IService _service;
public HomeController(IService service)
{
_service = service;
}
.....
}
But when I run it, I get an InvalidOperationException. Can anyone tell me what I'm doing wrong? Thanks.
Gibran