Solved

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

Posted on 2014-02-18
2
2,995 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

730 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