My project is a cross platform project. Which contains 3 Project 2 .Net-standard 2.0 and one startup project with .Net-framework 4.6.2.
The latest Autofac version(5.2.0) is not supporting .NetFramework 4.6.2.
I have encountered the error
autofac.core.registration.componentnotregisteredexception' in autofac.dll" builder.Build() couldn't instantiate the class object.
Error message:
An exception of type 'Autofac.Core.Registration.ComponentNotRegisteredException' occurred in Autofac.dll but was not handled in user code Additional information: The requested service 'ShipPageObjects.PageObjects.Login.LoginResolvePage' has not been registered. To avoid this exception, either register a component to provide the service, check for service registration using IsRegistered(), or use the ResolveOptional() method to resolve an optional dependency.
var builder = new ContainerBuilder();
builder.RegisterModule(new ContainerConfig());
builder.RegisterInstance(testConfig).As<ITestConfig>();
builder.RegisterModule(new ShipmentmentTest(testConfig));
builder.RegisterModule(new MaterialTest(testConfig));
Container = builder.Build();