Using Autofac to inject a dependency into the Main entry point in a console app

前端 未结 4 862
不思量自难忘°
不思量自难忘° 2020-12-10 05:34

Say I have a simple console application:

public static class Program
{
    private static ILog Log { get; set; }

    public static void Main()
    {
                


        
4条回答
  •  南笙
    南笙 (楼主)
    2020-12-10 05:58

    Had to change builder.RegisterType.AsSelf(); to builder.RegisterType().AsSelf(); to get this to work for me

提交回复
热议问题