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

  • Home
  • SEARCH
  • 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 8557789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:39:15+00:00 2026-06-11T15:39:15+00:00

In the AppHost class all the method overrides use the Funq container. I use

  • 0

In the AppHost class all the method overrides use the Funq container. I use Autofac within my ASP.NET MVC app (I run SS side-by-side with my MVC app).

  1. Is there a way to rather use that Autofac registration from global.asax.cs or is this an overkill to replace?
  2. I commented out this line in AppHost

    //ControllerBuilder.Current.SetControllerFactory(new FunqControllerFactory(container));

because it was messing up with my Autofac powered controllers. Is this enough to prevent Autofac and Funq having issues within my app? Or does Funq set itself as a default DependencyResolver anywhere else?

  • 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-11T15:39:17+00:00Added an answer on June 11, 2026 at 3:39 pm

    Func and AutoFac can work together. With ServiceStack you instruct func to use an AutoFac adapter. This page here tells you how to use different IoC containers. It even provides the code for an AutofacIocAdapter class. https://github.com/ServiceStack/ServiceStack/wiki/The-IoC-container

    public class AutofacIocAdapter : IContainerAdapter
    {
        private readonly IContainer _container;
    
        public AutofacIocAdapter(IContainer container)
        {
            _container = container;
        }
    
        public T Resolve<T>()
        {
            return _container.Resolve<T>();
        }
    
        public T TryResolve<T>()
        {
            T result;
    
            if (_container.TryResolve<T>(out result))
            {
                return result;
            }
    
            return default(T);
        }
    }
    

    Then in the AppHost Configure(Container container) method you need to enable this adapter:

    //Create Autofac builder
    var builder = new ContainerBuilder();
    //Now register all depedencies to your custom IoC container
    //...
    
    //Register Autofac IoC container adapter, so ServiceStack can use it
    IContainerAdapter adapter = new AutofacIocAdapter(builder.Build())
    container.Adapter = adapter;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Asp.Net mvc with ServiceSTack Mvc powerpack There is a row in AppHost: ControllerBuilder.Current.SetControllerFactory(new FunqControllerFactory(container));
I have a scenario wherein my ASP.NET MVC 3 web application hosted in IIS
After setting up an ASP.NET website in IIS7 I get an Internal Server Error
In Yii, when access to <app-host>/index.php?r=<mycontroller>/<myaction> , the framework will start to run code
In trying to configure ServiceStack.net to use Ninject as its IOC, I am getting
I'm having problem with getting ServiceStack [Authentication] attribute to work in ASP.Net MVC4 controller,
When I debug my ASP.NET Web Site I get the following error: The files
I have a set of commands that I'd like to run and do some
I'm trying to use APPCMD to set debug=false in web.config , per the documentation
I'm trying to deploy a Rails app to a CentOS server running Passenger. The

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.