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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:19:08+00:00 2026-05-18T08:19:08+00:00

I’m having problem moving from mvc 1 to mvc 2. In my old project

  • 0

I’m having problem moving from mvc 1 to mvc 2.
In my old project I used Active Record.

Now running on new project where trying to get data from reposetory

      public T[] SlicedFindAll(int firstResult, int maxResult, DetachedCriteria criteria)
  {
      return ActiveRecordMediator<T>.SlicedFindAll(firstResult, maxResult, criteria);
  }

I recive an error “The given key was not present in the dictionary.”

This is a stack trace:

[KeyNotFoundException: The given key was not present in the dictionary.]
System.Collections.Generic.Dictionary2.get_Item(TKey key) +9627953
NHibernate.Cfg.Mapping.GetPersistentClass(String className) +85
NHibernate.Cfg.Mapping.GetIdentifierType(String className) +66
NHibernate.Type.EntityType.GetIdentifierType(IMapping factory) +84
NHibernate.Type.EntityType.GetIdentifierOrUniqueKeyType(IMapping factory) +112
NHibernate.Type.ManyToOneType.GetColumnSpan(IMapping mapping) +66
NHibernate.Mapping.SimpleValue.IsValid(IMapping mapping) +96
NHibernate.Mapping.ToOne.IsValid(IMapping mapping) +144
NHibernate.Mapping.Property.IsValid(IMapping mapping) +80
NHibernate.Mapping.PersistentClass.Validate(IMapping mapping) +138
NHibernate.Mapping.RootClass.Validate(IMapping mapping) +68
NHibernate.Cfg.Configuration.ValidateEntities() +246
NHibernate.Cfg.Configuration.Validate() +44
NHibernate.Cfg.Configuration.BuildSessionFactory() +86
Castle.ActiveRecord.Framework.SessionFactoryHolder.GetSessionFactory(Type type) in d:\Dev\Out\castleproject-Castle.ActiveRecord-b0f7972\castleproject-Castle.ActiveRecord-b0f7972\src\Castle.ActiveRecord\Framework\SessionFactoryHolder.cs:135
Castle.ActiveRecord.Framework.SessionFactoryHolder.CreateScopeSession(Type type) in d:\Dev\Out\castleproject-Castle.ActiveRecord-b0f7972\castleproject-Castle.ActiveRecord-b0f7972\src\Castle.ActiveRecord\Framework\SessionFactoryHolder.cs:296
Castle.ActiveRecord.Framework.SessionFactoryHolder.CreateSession(Type type) in d:\Dev\Out\castleproject-Castle.ActiveRecord-b0f7972\castleproject-Castle.ActiveRecord-b0f7972\src\Castle.ActiveRecord\Framework\SessionFactoryHolder.cs:182
Castle.ActiveRecord.ActiveRecordBase.SlicedFindAll(Type targetType, Int32 firstResult, Int32 maxResults, Order[] orders, DetachedCriteria criteria) in d:\Dev\Out\castleproject-Castle.ActiveRecord-b0f7972\castleproject-Castle.ActiveRecord-b0f7972\src\Castle.ActiveRecord\Framework\ActiveRecordBase.cs:1420
Castle.ActiveRecord.ActiveRecordMediator.SlicedFindAll(Type targetType, Int32 firstResult, Int32 maxResults, Order[] orders, DetachedCriteria criteria) in d:\Dev\Out\castleproject-Castle.ActiveRecord-b0f7972\castleproject-Castle.ActiveRecord-b0f7972\src\Castle.ActiveRecord\Framework\ActiveRecordMediator.cs:185
Castle.ActiveRecord.ActiveRecordMediator
1.SlicedFindAll(Int32 firstResult, Int32 maxResults, DetachedCriteria criteria, Order[] orders) in d:\Dev\Out\castleproject-Castle.ActiveRecord-b0f7972\castleproject-Castle.ActiveRecord-b0f7972\src\Castle.ActiveRecord\Framework\ActiveRecordMediator.Generic.cs:241
Cameos.Core.Persistence.Repository1.SlicedFindAll(Int32 firstResult, Int32 maxResult, DetachedCriteria criteria) in d:\Dev\MVC2\Cameos\src\Cameos.Core\Persistence\Repository.cs:96
Cameos.Core.Paging.PagedList
1..ctor(IRepository1 repository, Int32 page, Int32 size, DetachedCriteria criteria) in d:\Dev\MVC2\Cameos\src\Cameos.Core\Paging\PagedList.cs:24
Cameos.Core.Paging.PagedList
1.Create(IRepository1 repository, Int32 page, Int32 pageSize, DetachedCriteria criteria) in d:\Dev\MVC2\Cameos\src\Cameos.Core\Paging\PagedList.cs:13
Cameos.Core.Paging.PaginationHelpers.Paginate(IRepository
1 repository, Int32 startPage, Int32 pageSize, DetachedCriteria criteria) in d:\Dev\MVC2\Cameos\src\Cameos.Core\Paging\PaginationHelpers.cs:52
Cameos.Core.Paging.PaginationHelpers.Paginate(IRepository1 repository, Int32 startPage, Int32 pageSize, Order order, ICriterion[] criteria) in d:\Dev\MVC2\Cameos\src\Cameos.Core\Paging\PaginationHelpers.cs:34
Cameos.Web.Areas.Admin.Controllers.CompanyController.Index(Nullable
1 page) in d:\Dev\MVC2\Cameos\src\Cameos.Web2\Areas\Admin\Controllers\CompanyController.cs:26
lambda_method(Closure , ControllerBase , Object[] ) +145
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +51
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) +409
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary
2 parameters) +52
System.Web.Mvc.<>c_DisplayClassd.b_a() +127
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func1 continuation) +436
System.Web.Mvc.<>c__DisplayClassf.<InvokeActionMethodWithFilters>b__c() +61
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func
1 continuation) +436
System.Web.Mvc.<>c_DisplayClassf.b_c() +61
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList1 filters, ActionDescriptor actionDescriptor, IDictionary2 parameters) +305
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +830
System.Web.Mvc.Controller.ExecuteCore() +136
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +111
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +39
System.Web.Mvc.<>c_DisplayClass8.b_4() +65
System.Web.Mvc.Async.<>c_DisplayClass1.b_0() +44
System.Web.Mvc.Async.<>c__DisplayClass81.<BeginSynchronous>b__7(IAsyncResult _) +42
System.Web.Mvc.Async.WrappedAsyncResult
1.End() +141
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +54
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +52
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +38
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8836913
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184

  • 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-05-18T08:19:09+00:00Added an answer on May 18, 2026 at 8:19 am

    A [BelongsTo] is misconfigured.

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

Sidebar

Related Questions

No related questions found

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.