[assembly: WebActivator.PreApplicationStartMethod(typeof(MyApp.App_Start.StructureMapMvc), "Start")]
namespace MyApp.App_Start
{
public static class StructureMapMvc
{
public static void Start()
{
var container = IoC.Initialize();
DependencyResolver.SetResolver(new SmDependencyResolver(container));
}
}
}
Here is my code that is supposed to run before Application_start in global.asax.
I was upgrading my web project from mvc 3 to mvc 4. So, In that process, I made a mistake in namespace. This was working before i corrected my namespace. It no longer works now. I reset iis/flushed dns/ rebuilt solution/removed the temporary .net files in C:WindowsMicrosoft.NETFramework64versionxxxxxx...Temporary ASP.NET Files
oot.
Nothing worked. Am i missing something here? The Initialize() method has all my structure map stuff dependency resolution stuff. So, I can't move forward without figuring this out. Tried to diagnose the problem for so many hours and i need help.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…