Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

项目上Autofac+aspectCore做ioc容器+aop,EnableParameterAspect之后Skywalking agent无法采集数据到服务器上 #296

Open
tangjingtai opened this issue Dec 30, 2022 · 0 comments

Comments

@tangjingtai
Copy link

tangjingtai commented Dec 30, 2022

public class AutofacServiceProviderFactory : IServiceProviderFactory<ContainerBuilder>
    {
        public ContainerBuilder CreateBuilder(IServiceCollection services)
        {
            ContainerBuilder containerBuilder = new ContainerBuilder();
            containerBuilder.Populate(services);
            containerBuilder.RegisterDynamicProxy(config =>
            {
                config.EnableParameterAspect();   // 注释掉此行代码,即可正常推送数据到Skywalking 服务器上
            });

            return containerBuilder;
        }

        public IServiceProvider CreateServiceProvider(ContainerBuilder containerBuilder)
        {
            if (containerBuilder == null)
                throw new ArgumentNullException("containerBuilder");
            return new AutofacServiceProvider(containerBuilder.Build());
        }
    }

请问这是什么原因导致的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant