Solved

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

Posted on 2014-02-18
2
2,766 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
Comment Utility
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
Comment Utility
The solution works and all is right with the world.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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 …
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

772 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now