For example, now I have another basecontroller. As a base class controller, for filtering permissions, login judgment and other functions, the other control from the original controller, inherit Basecontroller. Then Basecontroller rewrite the controller in the method onactionexecuting
When we revisit an action under the user controller at this point, the problem is that the server executes the OnActionExecuting method in Basecontroller, and at this point theIU is not created by Spring.net!! is still null
After several tests, it may be that the Basecontroller is the base class, and each instantiation (access to the subclass controller (Usercontroller) actually instantiates a base class internally). Spring.net has no way to gain access to the base class (Basecontroller) that is instantiated with the following subclass (Usercontroller), so IU will be null.
My workaround is as follows
Basecontroller, as a base class controller, must always be used, so set its constructor to static, execute only once, and assign values to IU at the same time, so that IU will always have values.
Spring.net Invalid filter controller for base class controller in MVC