Error System.Exception at Microsoft.Practices.Repository.RepositoryFactory.GetRepositoryType(Type repositoryInterface)

May 14, 2009 at 10:23 AM


After created DAL and BBL and test web, error occcure:

System.Exception: System.Configuration.ConfigurationErrorsException: Exception of type 'System.Configuration.ConfigurationErrorsException' was thrown.
  at Microsoft.Practices.Repository.RepositoryFactory.GetRepositoryType(Type repositoryInterface)
  at Microsoft.Practices.Repository.RepositoryFactory.Create(Type repositoryInterface, String connectionStringName)
  at Microsoft.Practices.Repository.RepositoryFactory.Create[TInterface](String connectionStringName)
  at VNTCMS_BBL.UserManager.saveUser(T_Users objUser) in F:\VNTCMS\VNTCMS_BBL\BaseClass.cs:line 19


anyone can tell me what error anh how to solve it


May 14, 2009 at 4:22 PM

It seem to be do lack of definition on your configuration file,  you need some thing like this for each Repository interface & Class on the repositoryFactory element



      <add interfaceType="REPOSITRY-INTERFACE, ASSEMBLY" repositoryType="REPOSITRY-CLASS, ASSEMBLY" />


Juan Pablo Schmiede

May 15, 2009 at 4:43 AM


I had solved it.

Now I have another problem with stored procedure. When I insert new user, in this SP have @userID out, how to I get this value ?

May 15, 2009 at 5:24 PM

The repository method should map the new ID to your entity