No parameterless constructor defined for this object. - WebForms

May 27, 2014 at 4:58 PM
Here's what I have.
in the global.asax
protected void Application_Start(object sender, EventArgs e)
IUnityContainer container = Application.GetContainer();
public class Bootstrapper
public static void Configure(IUnityContainer container)
    .RegisterType<IDataContextAsync, FESWebContext>()
    .RegisterType<IUnitOfWorkAsync, UnitOfWork>()
    .RegisterType<IRepositoryAsync<FES.Models.Account>, Repository<FES.Models.Account>>()
    .RegisterType<IAccountService, AccountService>();
public Repository(IDataContextAsync context, IUnitOfWorkAsync unitOfWork)
_context = context;
_unitOfWork = unitOfWork;

var dbContext = context as DbContext;

if (dbContext != null)
    _dbSet = dbContext.Set<TEntity>();
But, when I bind the Service Layer to a Grid, I get - "the repository does not contain a constructor that take 0 arguments". The breakpoint in the service layer is never hit.
also, where/how do i set the context connection string
May 29, 2014 at 5:37 PM
Got it resolved.

Everything done thus far was correct, I just had to this (below) to the

private IAccountService accountService;
   public IAccountService AccountService
       get { return accountService; }
       set { accountService = value; }
Good luck !
Marked as answer by lelong37 on 6/3/2014 at 11:02 AM