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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:18:51+00:00 2026-06-05T11:18:51+00:00

Before posting this I made sure to read all suggestion made from SO. The

  • 0

Before posting this I made sure to read all suggestion made from SO.

The application currently has two projects one for the web application and one for the Entity Frame work (version 4.0). We are trying a tool from RSSBus for the Quickbooks Provider description here
Setting it up was easy enough. I prefixed QB on all the entities and generated the QB.tt file, no issues. Both edmx files are housed in the same project using a shared namespace (SMR.Model)

When I rebuilt the project to run it the global.asax.cs file threw an error:

DefaultModel.RegisterContext(typeof(SMR.Model.SMREntities),
new ContextConfiguration() { ScaffoldAllTables = true });

The error given was:

The given key was not present in the dictionary.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

Source Error:
Line 36: public static void RegisterRoutes(RouteCollection routes)
Line 37: {
Line 38: DefaultModel.RegisterContext(typeof(SMR.Model.SMREntities),
Line 39: new ContextConfiguration() { ScaffoldAllTables = true });
Line 40:

Source File: C:\all\src\smr\smr.pl.Web\Global.asax.cs Line: 38

Stack Trace:
[KeyNotFoundException: The given key was not present in the dictionary.]
System.Collections.Generic.Dictionary2.get_Item(TKey key) +9624829
System.Web.DynamicData.ModelProviders.EFDataModelProvider..ctor(Object contextInstance, Func
1 contextFactory) +800
System.Web.DynamicData.ModelProviders.SchemaCreator.CreateDataModel(Object contextInstance, Func1 contextFactory) +126
System.Web.DynamicData.MetaModel.RegisterContext(Func
1 contextFactory, ContextConfiguration configuration) +378
System.Web.DynamicData.MetaModel.RegisterContext(Type contextType, ContextConfiguration configuration) +88
smr.pl.Web.Global.RegisterRoutes(RouteCollection routes) in C:\all\src\smr\smr.pl.Web\Global.asax.cs:38
smr.pl.Web.Global.Application_Start(Object sender, EventArgs e) in C:\all\src\smr\smr.pl.Web\Global.asax.cs:91

[HttpException (0x80004005): The given key was not present in the dictionary.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +9170941
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +131
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +194
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +339
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +253

[HttpException (0x80004005): The given key was not present in the dictionary.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9090044
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +256

With so little to go on as to what could eb the problem I looked at the .config files to see if they were wrong and all checked out as ok.

<add name="SMREntities" connectionString="metadata=res://*/;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=localhost;Initial Catalog=SMR;Persist Security Info=True;User ID=sa;Password=XXX;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient"/>
<add name="RSSQBEntities" connectionString="metadata=res://*/Model.QBOE.csdl|res://*/Model.QBOE.ssdl|res://*/Model.QBOE.msl;provider=System.Data.RSSBus.QuickBooks;provider connection string=&quot;Offline=False;Application Id=987654321;Connection Ticket=TGT-000-T_xxxxxxxxxxxxxxxxxxxx;Online Login=ohno&quot;" providerName="System.Data.EntityClient" />

Any thoughts as to what is causing the structure to fail like this?

  • 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-05T11:18:53+00:00Added an answer on June 5, 2026 at 11:18 am

    I finally figured out the “real” problem. I first seperated the two models into separate projects. The problem I was facing was the metadata was being integrated into the same assembly namespace. I resolved my issue by updating the res://*/ section

    <add name="SMREntities" connectionString="metadata=res://SMR.Model/;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=localhost;Initial Catalog=SMR;Persist Security Info=True;User ID=sa;Password=XXX;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient"/>
    <add name="RSSQBEntities" connectionString="metadata=res://SMR.QBOE/Model.RSSQBOE.csdl|res://SMR.QBOE/Model.RSSQBOE.ssdl|res://SMR.QBOE/Model.RSSQBOE.msl;provider=System.Data.RSSBus.QuickBooks;provider connection string=&quot;Offline=False;Application Id=987654321;Connection Ticket=TGT-000-T_xxxxxxxxxxxxxxxxxxxx;Online Login=ohno&quot;" providerName="System.Data.EntityClient" />
    

    A Classic “the issue is not the issue”.

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

Sidebar

Related Questions

I have read a ton before posting this and tried what i could to
Before you all get pissy about me posting this question again, let me explain
Hey everyone, I made sure there wasn't a similar discussion before posting but forgive
I've read every response I could fine on SO before posting this question. Although
First of all, I know this topic has been brought up several times before
Before posting this I've read through but I'm still not clear on how to
I've made extensive research about auto-increment before posting this but couldn't find similar case:
NOTE : Right before posting this question it occurred to me there's a better
I searched StackOverflow before posting this question but I wasn't able to find the
I have searched for this before posting.. I have a page in my site

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.