Wednesday, September 26, 2018

WebAPI | Dependency Injection Problem

Hey everyone, we're working on migrating an existing Windows desktop application to a web application.

We are trying to use WebAPI as our entry point but having a bit of trouble.

Existing backend data access and business logic DLL's are being referenced by the new web api project (not project references). Using StructureMap to inject services from those DLL's.

Existing backend dependency injection is handled using Spring.Net.

We have a simple controller that is calling one of the simple services to retrieve some data.

When testing the API we're getting a json response but it is simply a null reference exception thrown against a property of one of the services injected.

So the injection of the service from the DLL into our web api is working ok, but that service's properties (handled by Spring.Net) are not being resolved.

Have tried google but it's kind of hard to summarize this problem into a search query. Anyone able to point me toward a resource that could help with this issue?

Any help appreciated!

WebAPI | Dependency Injection Problem Click here
  • Blogger Comment
  • Facebook Comment

0 comments:

Post a Comment

The webdev Team