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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:47:48+00:00 2026-06-17T07:47:48+00:00

The problem: I get the following error when I build: ‘.Controllers.ControllerBase’ does not contain

  • 0

The problem:

I get the following error when I build:

“‘.Controllers.ControllerBase’ does not contain a constructor that
takes 0 arguments”

My base controller looks like this:

public abstract class ControllerBase : Controller
{
    public CompanyChannel<IAuthorizationService> authorizationServiceClient;
         public ControllerBase(CompanyChannel<IAuthorizationService> authService)
    {
        this.authorizationServiceClient = authService;
    }
}

An example controller that makes use of the Base..

public partial class SearchController : ControllerBase
{
    protected CompanyChannel<IComplaintTaskService> complaintTaskServiceChannel;
    protected IComplaintTaskService taskServiceClient;      

    protected ComplaintSearchViewModel searchViewModel;

    #region " Constructor "

    public SearchController(CompanyChannel<IComplaintTaskService> taskService, CompanyChannel<IAuthorizationService> authService, ComplaintSearchViewModel viewModel)
        : base(authService)
    {
        searchViewModel = viewModel;
        this.complaintTaskServiceChannel = taskService;
        this.taskServiceClient = complaintTaskServiceChannel.Channel;
    }

    #endregion

    public virtual ActionResult Index()
    {
        return View();
    }
}

This seems to be tripping T4MVC.

Should I just not be passing params into the base constructor?

  • 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-17T07:47:49+00:00Added an answer on June 17, 2026 at 7:47 am

    Your abstract class must have a default constructor. When you have any constructors in the subclasses that doesn’t call the base class ctor means, compiler will automatically call base class’s default ctor, therefore you must have one in base class.

    Following demo will be helpful to understand ctor chaining in c#

    class Base
    {
        public Base()
        {
            Console.WriteLine("Base() called");
        }
    
        public Base(int x)
        {
            Console.WriteLine("Base(int x) called");
        }
    }
    
    class Sub : Base
    {
        public Sub()
        {
            Console.WriteLine("Sub() called");     
        }
    }
    

    and from within your Main() create

    new Sub();
    

    and observe the console output

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

Sidebar

Related Questions

The problem is taht I get the following error qhile deploying my project to
Problem Description: Occassionally when debugging, I get the following error. I'm using visual studio
When I try to do that I get the following error: Changes to 64-bit
When I use msbuild I get the following error: CS2001 Source file could not
I get the following error while trying to build a normal C# application. Error
When I run an executable that I built, I get the following error: The
When I try to build my setup project, I get the following error: An
when i run my application, i get following exception. I have no problem with
I get the following problem when trying to open an ASPX page in FireFox:
Problem: When I run my tests, I get the following message in the command

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.