question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.Net core: Error integrating services

See original GitHub issue

Hi, I’m having problems doing a very simple project and I wanted to know what I’m doing wrong. What I’m looking for is to expose routes from a module and from what I understand that is achieved with the services.

1- Download a new project from https://aspnetboilerplate.com/Templates with the following options:

  • ASP.NET core 2.X
  • Multi page web application
  • Options: unchecked
  • Project name: TEST
  • Check stable version

Restore Nuget Packages

2- Create a service

namespace Test
{
    public class TestAppService : TestAppServiceBase
    {
        public string Hello()
        {
            return "Hello world";
        }
    }
}

3- Add configuration

namespace Test
{
    [DependsOn(
        typeof(TestCoreModule), 
        typeof(AbpAutoMapperModule))]
    public class TestApplicationModule : AbpModule
    {

        public override void PreInitialize()
        {
            base.PreInitialize();
            Configuration.Modules.AbpAspNetCore().CreateControllersForAppServices(typeof(TestApplicationModule).Assembly, moduleName: "app", useConventionalHttpVerbs: true);
        }

        public override void Initialize()
        {
            IocManager.RegisterAssemblyByConvention(typeof(TestApplicationModule).GetAssembly());

        }
    }
}

Error

Then i get this error:

Castle.MicroKernel.ComponentNotFoundException “No component for supporting the service Abp.AspNetCore.Configuration.IAbpAspNetCoreConfiguration was found”

I saw many people have the same problem but I can not find the solution. I’m running on MacOsx High Sierra and dotnet 2.2.104

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
malimingcommented, Mar 5, 2019

@zamudio-fabian

add typeof(AbpAspNetCoreModule))] to solve

[DependsOn(
	typeof(TestCoreModule), 
	typeof(AbpAutoMapperModule),
	typeof(AbpAspNetCoreModule))]
public class TestApplicationModule : AbpModule
{
	public override void PreInitialize()
	{
		base.PreInitialize();

		Configuration.Modules.AbpAspNetCore().CreateControllersForAppServices(
			typeof(TestApplicationModule).Assembly, moduleName: "app", useConventionalHttpVerbs: true);
	}

	public override void Initialize()
	{
		IocManager.RegisterAssemblyByConvention(typeof(TestApplicationModule).GetAssembly());
	}
}
0reactions
zamudio-fabiancommented, Mar 5, 2019
typeof(AbpAspNetCoreModule)

Solved, thank you

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handle errors in ASP.NET Core web APIs
Show 2 more. This article describes how to handle errors and customize error handling with ASP.NET Core web APIs.
Read more >
Multiple DB providers error in integration tests in ASP.NET ...
The error indicates you've create a dbcontext with two database providers. Since you've replaced DbContextOptions in IServiceCollection with ...
Read more >
Global Error Handling in ASP.NET Core Web API
NET Core. In this article, we are going to handle errors by using a try-catch block first and then rewrite our code by...
Read more >
Problem Details responses everywhere with ASP.NET ...
ASP.NET Core has supported problem details since version 2.1, however it was not been uniformly used across all ASP.NET Core components. It was ......
Read more >
Integrating with ASP.NET Core 2 and Newer
OverviewThe SDK can be integrated into an ASP.NET Core 2 application on two levels: Each ASP.NET Core controllers' method implementation could be surrounded ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found