Strange behaviour with StructureMap / ASP.MVC / Visual Studio / LinqToSql

前端 未结 4 1589
梦如初夏
梦如初夏 2020-12-18 05:45

I have been using the new MVC framework with StructureMap recently and have had good results overall, however, I keep running into a very strange error that I cannot underst

4条回答
  •  再見小時候
    2020-12-18 06:17

    One common mistake when using DI containers with ASP.NET MVC is that many DI containers default to a Singleton pattern. I don't know if that's the case here, but you should double check. ASP.NET MVC requires that the controller is created on every request because it has per-request state and context.

提交回复
热议问题