Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9313287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T01:50:44+00:00 2026-06-19T01:50:44+00:00

In application_start() I have the following code. When the Account Controller get’s created I

  • 0

In application_start() I have the following code.
When the Account Controller get’s created I get the parameterless constructor error.
AccountController does not have a parameterless constructor. It seems that autofac is no longer configured?

Account Controller Expects the following.

public AccountController(IFlexMembershipProvider membership, IFlexOAuthProvider openAuth)

I am not sure why autofac is not injecting the dependences?

var builder = new ContainerBuilder();

builder.RegisterType<DataContext>()
    .As<IRepository>()
    .As<DbContext>().InstancePerLifetimeScope();

builder.RegisterType<FlexMembershipProvider>().As<IFlexMembershipProvider>();
builder.RegisterType<FlexMembershipProvider>().As<IFlexOAuthProvider>();
builder.RegisterType<FlexRoleProvider>().As<IFlexRoleProvider>();

builder.RegisterType<UserStorage>().As<IFlexUserStore>().InstancePerLifetimeScope();
builder.RegisterType<RoleStorage>().As<IFlexRoleStore>().InstancePerLifetimeScope();
builder.RegisterType<DefaultSecurityEncoder>().As<ISecurityEncoder>().SingleInstance();
builder.RegisterType<AspnetEnvironment>().As<IApplicationEnvironment>();
builder.RegisterType<InvestorService>().As<IInvestorService>();
builder.RegisterType<InvestmentService>().As<IInvestmentService>();
builder.RegisterType<BrokerService>().As<IBrokerService>().As<IListService<Broker>>();
builder.RegisterType<PortfolioManagerService>().As<IListService<PortfolioManager>>();

builder.RegisterModelBinderProvider();

var container = builder.Build();

DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T01:50:46+00:00Added an answer on June 19, 2026 at 1:50 am

    You need to register the assembly that contains your controllers before calling the .Build method:

    builder.RegisterControllers(typeof(MvcApplication).Assembly);
    var container = builder.Build();
    

    In this example I assumed that your application class is called MvcApplication and took its assembly. If your controllers are defined in a different assembly you should specify this assembly.

    The documentation of AutoFac has an example that you could have gone through.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code in my Application_Start(): protected void Application_Start() { AreaRegistration.RegisterAllAreas(); WebApiConfig.Register(GlobalConfiguration.Configuration);
I have the following code at some point in Application_Start MembershipUserCollection users = Membership.GetAllUsers();
I have a Windows Service that does the following when started. When running via
i have following code in my php jquery call... <object type=application/x-shockwave-flash data=mysounds/player.swf id=audioplayer1 height=1
I have the following code: NSURL *URL = [NSURL URLWithString:[@some-address]]; NSMutableURLRequest *request = [NSMutableURLRequest
Right now, in development I have the following code in the Global.asax.cs file that
I have a batch file using the following code: @echo off :: BatchGotAdmin :-------------------------------------
HI I have the following code, when I call the Ping method the first
I have the following code in my App.xaml.cs private void App_Start(object sender, StartupEventArgs e)
I have created some code that emails an html email to a given address.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.