Working with IoC (Siege)
TeamJJ
Posted on
Sep 10 2016
I've implemented RayGun at the past few places of employment on over a dozen projects with no problem. Kudos to the RayGun team! Where I'm currently at, I run into an odd problem, that I'm assuming it's due to this project using Siege (which I know nothing about).
It's a Microsoft Web API project (latest version), and I followed the tutorial on how to wire it in to the app. I have a /version route that has no constructor whatsoever, that literally just spits out the version. I figured I'd put a test exception on that Get to make sure RG was wired correctly.
When trying to request that resource, I do not hit my test exception, instead I get the wonderful stacktrace below, which IS actually reported to my RayGun dashboard. This tells me RayGun is working just fine, but perhaps Siege is not okay with the interfaces wired up in RayGunWebApiClient?? Any Ideas?
Exception:
<ExceptionMessage>
An error occurred when trying to create a controller of type 'VersionController'. Make sure that the controller has a parameterless public constructor.
</ExceptionMessage>
Stack Trace:
Message: [NullReferenceException: Object reference not set to an instance of an object.]
Siege.ServiceLocator.Web.HttpResolutionStore.Add(List`1 contextItem):6
Siege.ServiceLocator.ServiceLocator.GetInstance(Type type, IResolutionArgument[] arguments):18
Siege.ServiceLocator.ServiceLocator.GetInstance(Type type):9
OneTechnologies.Framework.WebApi.Siege.ApiServiceLocatorDependencyResolver`1.GetService(Type serviceType):39
System.Web.Http.Dispatcher.DefaultHttpControllerActivator.GetInstanceOrActivator(HttpRequestMessage request, Type controllerType, Func`1& activator):0
System.Web.Http.Dispatcher.DefaultHttpControllerActivator.Create(HttpRequestMessage request, HttpControllerDescriptor controllerDescriptor, Type controllerType):48
Deleted User
Raygun
Posted on
Sep 20 2016
Hi there,
I was going to see if I could reproduce this issue on a new project but I'm unable to find the Siege dlls. They seem to have been removed from nuget/git and are not available anymore. Are you able to provide me with a copy of the package or your proof of concept/sample application so I can look into it a bit further?
Regards, Jeremy.
TeamJJ
Posted on
Sep 21 2016
I apologize for my late reply. I got your previous email and I got pulled off into something else, so my POC is on pause for right now. I can not find the live DLL's anywhere either at the moment, so I attached them here for the ones we're on. I'll try and get together a POC to send off to you guys, but right now, all I can do is send the dll's.
Thanks again for the responsiveness!
TeamJJ
Posted on
Sep 29 2016
Any luck, Jeremy?
Deleted User
Raygun
Posted on
Sep 29 2016
Hi, sorry for the late response.
Since Siege IoC is no longer in development we would recommend moving to another framework that is supported, or at least one where the source is still available. We could try and do a prototype but if it turns out to be a bug/issue with Siege then you'd be stuck without a way forward. We are currently using Autofac in both our .NET MVC and API applications and would recommend that as a starting point as we know it works well. Sorry this is not the answer you were hoping for.
Jeremy