I've created a new fresh vanilla MVC 5 .net 4.5 project, and added StructureMap as a Nuget package. Nothing extra added like models or interfaces yet.
All works fine until I add this row in Global.asax.cs: StructuremapMvc.Start();
I get error that I can't register a module when application have initialized?!
My IoC.cs file looks like this:
public static IContainer Initialize() {
ObjectFactory.Initialize(x =>
{
x.Scan(scan =>
{
scan.TheCallingAssembly();
scan.WithDefaultConventions();
});
});
return ObjectFactory.Container;