We have a functioning ASP.NET MVC 5.2.2
website running on .NET Framework 4.5.1
hosted on a web farm with numerous servers. The web application integrates with AppyDynamics. The AppDynamics .NET Agent 4.3.2.1
is installed on each server. I noticed that it's an outdated version but we are unable to update yet.
We use StructureMap for our IoC.
<package id="structuremap" version="3.1.1.134" targetFramework="net451" />
<package id="StructureMap.MVC5" version="3.1.1.134" targetFramework="net451" />
<package id="structuremap.web" version="3.1.0.133" targetFramework="net451" />
Sometimes something happens across the entire farm, perhaps by a:
- WebDeploy
- Server restart
- Manual IIS reset
There is a chance that one of the web applications on an affected node will not function properly. It will start up but the IoC never executed resulting in the following error:
System.InvalidOperationException:
An error occurred when trying to create a controller of type 'TestController'. Make sure that the controller has a parameterless public constructor.
---> System.MissingMethodException: No parameterless constructor defined for this object.
We can't prove it but we think that the AppDynamics Agent intercepts the IIS application just at the wrong time. The web application starts but the IoC is not configured hence the error above.
My Questions
Is this a known issue? I really did search online
If you have experienced this, do you have an idea of what the possible cause(s) can be?
How can we fix this annoying intermittent error for our customers?
Is it as simple as updating something? Like StructureMap & AppDynamics?
Edit
The web application is deployed to a network shared folder which feeds all the web servers in the farm. :(
The IoC setup must be working if it is working for all the other nodes. This problem seemed to have started since the installation of the AppDynamics Agents.
It only happens if IIS is reset across the farm. One of the sites on that node will throw the error I mentioned above.
I am still investigating on my side
Application_Start()
from the Global.asax
. For a crisp view of the image, click on it.