开发者

Autofac configuration

开发者 https://www.devze.com 2023-04-11 02:55 出处:网络
I am just starting with Autofac and I am trying to configure a simple registration, according to the docs this should work:

I am just starting with Autofac and I am trying to configure a simple registration, according to the docs this should work:

var builder = new ContainerBuilder();
builder.RegisterType<CurrentUserInfo>().As<ICurrentUserInfo>();

But I am getting:

Incorrect Number of type parameters

And according to the docs:

 _containerProvider = new ContainerPr开发者_C百科ovider(builder.Build());

But there is no Build Method...


Restarted Visual Studio..corrupted cache or something


Make sure you have referenced both Autofac.dll and Autofac.Configuration.dll.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号