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 8800453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:35:33+00:00 2026-06-14T00:35:33+00:00

I am developing .NET WEB Api REST Service using framework 4.5 and the architectural

  • 0

I am developing .NET WEB Api REST Service using framework 4.5 and the architectural direction now is to separate functional areas of our API. In other words, placing controllers into separate assemblies, e.g. having controllers in assemblies like company.web.administration, company.web.claims, etc.

After experimenting with it, I noticed the power of the MVC framework. I can place controllers into separate class libraries but as long as these libraries are in the bin folder, they don’t even have to be referenced. MVC finds them in the assemblies and API calls work fine.

But under this architecture, the problem arises that we might get large number of these controller libraries. So, it would be helpful to pack them together under bin\controllers, for example.
Dropping controllers into sub-folder ceases ability of ASP.NET MVC WEB API Framework to find them.

I am searching for a way to tell Framework to look for these controllers under my directories as well as in bin. One of the options I used is I modified Web.config file as following:

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <probing privatePath="bin;bin\controllers;controllers"/>
    </assemblyBinding>
</runtime>

That didn’t work. Any ideas?

  • 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-14T00:35:34+00:00Added an answer on June 14, 2026 at 12:35 am

    A while ago, I have written a blog post about how to do that – http://www.strathweb.com/2012/06/using-controllers-from-an-external-assembly-in-asp-net-web-api/

    Basically, you need to roll out your own IAssembliesResolver or override the GetAssemblies() method of DefaultAssembliesResolver.

    public class CustomAssemblyResolver : IAssembliesResolver
    {
      public ICollection<Assembly> GetAssemblies()
      {
        List<Assembly> baseAssemblies = AppDomain.CurrentDomain.GetAssemblies().ToList();
        var controllersAssembly = Assembly.LoadFrom(@"C:\PATH_TO_MY_CONTROLLERS_ASSEMBLY");
        baseAssemblies.Add(controllersAssembly);
        return baseAssemblies;
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Our team is developing our first web api and using Service Stack to expose
I am developing some sort of service using asp.net mvc 4 web api. On
The background I'm developing a REST API for a C#.NET web application using WCF.
I am developing Services using ASP.NET Web API and have plan to use Service
I am developing web-application using Google Maps API and ASP.NET Ajax. Here is my
I am developing an application using ASP.Net Web API and to configure application routing,
I am developing a solution in .Net utilising the VMWare Web Service API to
I am developing ASP.NET MVC WEB API service. As everywhere i need security tokens.
When developing ASP.NET websites (using VB.NET web forms) - a lot of my time
I'm been developing Ruby on Rails previously. I'm now looking at an ASP.net web

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.