Solved

The type or namespace name 'Objects' does not exist in the namespace 'System.Data'

Posted on 2014-02-18
2
2,950 Views
Last Modified: 2014-02-18
I built an MVC 4 Entity Framework 5 for 6 weeks.  I have compiled the project many times successfully.  I copied the project to a different machine to develop during the blizzard.  Again I have compiled it many times.  

Then I needed to add another controller and the wizard kept returning a "object reference needs an instance of an object" error.  After much research and many attempts at fixing this, I finally fixed this by carrying out a repair of the VS 2012 installation.  I added the controller, added code to the controller, and then added an stored procedure to the database and carried out an update from the database for the Entity Framework.  Once this was completed I carried out a check of the Model Browser and verified the existence of the stored procedure in both the list of stored procedures and Complex objects.  After this I did a compile.  I got the above error in the  context.cs file which caused errors everywhere the context is called.  I don't know where this came from.  After entering a forum entry, I moved the project back to the computer at work after the long weekend.  The error is still displayed with the red squiggly lines under the using System.Data.Objects statements.  I did a build and suddenly the appears a "restoring Nuget Packages that appear in file packages.config" message and it starts installing the Nuget Packages for DotNetOpenAuth which I had removed as being undesired since we are not permitted to use it.  Then it went on to install other Nuget Packages like System.Spatial, which I was not even aware of having had installed since we have no use for that either.

When that was completed then I get a warning that the web.config element "entityFramework has invalid child elements "providers" List of possible elements expected: 'contexts'.

However I made no changes to that section of the web.config.  What is there is what Visual Studio put there.

I am totally at a work stoppage here because of this.

"Help me Obi-wan Kenobi.  You're my only hope."
0
Comment
Question by:Edward Joell
  • 2
2 Comments
 

Accepted Solution

by:
Edward Joell earned 0 total points
ID: 39867815
I fixed it.  Somehow, apparently during the reinstall of Visual Studio, the reference to System.Data.Entity was lost.  While one would not think this had anything to do with System.Data.Objects, in fact once this references was re-added, then all of the squiggly lines went away.  And the build completed successfully.   Very strange.
0
 

Author Closing Comment

by:Edward Joell
ID: 39867852
The solution works and all is right with the world.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question