---
title: "Why does my ASP.NET Core app say \"Unable to resolve service for type\" at startup?"  
description: "Why does my ASP.NET Core app say \"Unable to resolve service for type\" at startup?"  
author: "Magdalena Michalska"  
published: 2026-11-13  
updated: 2026-11-13  
canonical: https://www.mindstick.com/forum/163002/why-does-my-asp-net-core-app-say-unable-to-resolve-service-for-type-at-startup  
category: "C# and .NET"  
tags: ["dependency-injection", "asp.net core", ".NET 8", "DI container", "errors"]  
reading_time: 1 minute  

---

# Why does my ASP.NET Core app say "Unable to resolve service for type" at startup?

My app crashes with "Unable to resolve service for type 'IOrderService' while attempting to activate 'OrderController'". The interface exists. What am I missing?

## Replies

### Reply by Guzel Mukhametova

The message means the dependency injection container was asked to build OrderController, saw that it needs IOrderService, and found no registration for it. Having the interface and class in your project is not enough; you must register them.

Fix it in Program.cs:

```
builder.Services.AddScoped<IOrderService, OrderService>();
```

Then check these usual causes:

- You registered the class but not the interface, or the other way round.
- The registration is in a different project's extension method that you never call.
- The implementation itself needs another service that is missing. Read the full message: the real missing type is often one level deeper.
- A singleton depends on a scoped service. That gives a different error ("Cannot consume scoped service"), but it is related to lifetimes.

Turn on ValidateOnBuild in development to catch these when the app starts instead of at the first request.


---

Original Source: https://www.mindstick.com/forum/163002/why-does-my-asp-net-core-app-say-unable-to-resolve-service-for-type-at-startup

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
