This project is read-only.


My controllers do not have a default constructor. Error in file XXController.generated.cs


I install AutoT4MVC then T4MVC using nuget Install-Package T4MVC in my projet.

But an error occurs in all generated classes for my controllers

Sample error:

Error 9 'BindSolution.Framework.Web.Controllers.BindEntityController<CreditoImobiliarioBB.Model.Agencia,CreditoImobiliarioBB.Web.ViewModels.AgenciaViewModel>' does not contain a constructor that takes 0 arguments I:\Clients\\src\CreditoImobiliarioBB\CreditoImobiliarioBB.Web\agenciasController.generated.cs 25 10 CreditoImobiliarioBB.Web
Closed Jan 28, 2015 at 4:12 PM by KevinKuszyk
As part of our move to GitHub, we are closing all the outstanding issues on CodePlex.

If your issue is still valid, please re-open it on GitHub:

Thanks for contributing!


davidebbo wrote Oct 10, 2012 at 12:32 AM

It might be something specific to your project. Can you try to isolate to a minimal repro you can share (e.g. on github)?

Ridermansb wrote Oct 10, 2012 at 3:25 AM

Any controller that does not have a default controller will have this problem.
See this:

davidebbo wrote Oct 10, 2012 at 4:37 AM

Ah yes, T4MVC indeed has this restriction. It's unclear whether there is an easy way to address it without drastically changing the way things work.

Ridermansb wrote Oct 10, 2012 at 1:05 PM

Yeah, I had to add a default constructor to T4MVC work.