0

I have a project with both Web and Worker roles. Reading and writing to the database using Entity Framework in the Web role works fine. However, I am having issues when attempting to access data in that same database from the Worker role. It appears that the database is not being referenced properly because when I do a query, entries that I know exist do not get returned. Upon debugging, my breakpoints show that the database has 0 entries and I know this is not the case because the Web role accesses the same data without a problem.

I think the issue may be a setting or reference that I am missing, but I haven't been able to figure it out yet. Any help would be appreciated.

TheKarateKid
  • 772
  • 11
  • 19
  • are you sure your worker role uses the very same connection string as your WebRole? – astaykov Dec 06 '12 at 15:52
  • The App.config was missing the connectionStrings portion that was present in the web role. Your comment helped lead me to my solution. Thanks! – TheKarateKid Dec 06 '12 at 16:34

1 Answers1

0

It turns out that the App.config was missing the entire portion of the configuration that was present in Web.config. Since the part of the App.config was missing entirely, I was not aware that this attribute was to be included in App.config as well.

TheKarateKid
  • 772
  • 11
  • 19