Visual Studio 2012 MVC build error: The type or name of the Infrastructure namespace does not exist in the System.Data.Entity namespace

Update: The link in System.Data.Entity is specified in the link manager.

Customization

I get an error when trying to start an ASP.NET MVC 3 web application out of the box. I did not make any changes.

I just chose File> New Project> Visual C #> ASP.NET MVC 3 Web Application and left all the default settings intact.

In the "Project Settings" section, I selected the "Internet" application for the template, "Razor" for the viewing engine and checked the use of semantic markup HTML5.

Then I immediately chose Build> Build Solution, which failed and gives this error and five other warnings (shown in the screenshot).

Mistake

Error 1 The type or name of the Infrastructure namespace does not exist in the System.Data.Entity namespace (do you miss the assembly reference?)

C: \ Users \ johndoe \ Documents \ Visual Studio 2012 \ Projects \ MvcApplication1 \ MvcApplication1 \ Global.asax.cs

Yes I know...

... this question has been asked - many times - but the answers to these posts do not provide adequate information to solve my problem.

Please be specific in your answer with step-by-step instructions, as I am new to Visual Studio and its MVC application development framework.

Question

What can cause Visual Studio to not work right out of the box? This is a new installation. Is there an update that could cause this problem or could fix this problem?

Screenshot

Screenshot of Visual Studio Error List

System Information

Microsoft Visual Studio Ultimate 2012 Version 11.0.61030.00 Update 4

Microsoft.NET Framework Version 4.5.50709

Installed Products:

  • Architecture and modeling tools
  • LightSwitch for Visual Studio 2012
  • Office Developer Tools
  • Team Explorer for Visual Studio 2012
  • Visual basic 2012
  • Visual C # 2012
  • Visual C ++ 2012
  • Visual F # 2012
  • Visual Studio 2012 Code Analysis Spell Checking
  • Development Tools for Visual Studio 2012 SharePoint
  • ASP.NET and Web Tools
  • LNDevEnv
  • NuGet Package Manager
  • Preliminary analytical document for visualization
  • SQL Server Data Tools
+7
c # build asp.net-mvc visual-studio-2012
source share
5 answers

On the ribbon, select the drop-down menu that says "Debug" and select Configuration Manager. From there, select the drop-down list in the "Platform" section, click "Create," and now in the "New Platform" section, select x86. Click OK and close the configuration manager. Try to create your own project.

System.data.entity is a 32-bit build, so you may need to build your project as x86. If this does not work, you can follow the same steps above and select x64 and try again.

AFAIK you do not need to do this, I inexorably followed your steps and had no problems building in any processor.

You can also try setting the entity. Right-click on links, manage nuget packages, click online and you will see how EntityFramework appears in the center column.

+4
source share

I had the same problem and resolved it by adding a link to the Entity Framework. This can be done by right-clicking the Link link in the Solution Explorer and selecting Add Referee. Then go to C: \ Program Files (x86) \ Microsoft Visual Studio 11.0 \ Common7 \ IDE. Choose EntityFramework.dll.

+9
source share

I had the same problem in MVC 4 (it should be similar in MVC 3), here is what fixed for me:

  • Expand your links in the project explorer and click on the assembly link (System.Data.Entity and any other assembly link used from the box will be present here)

  • In the properties window, change the Copy Local property to "True"

  • Repeat the above two steps for all assembly references that are included but throw assembly errors

Running the application from the MVC 3/4 application should work after you have done this.

+3
source share

This solution may work for you if changing build settings to x86 causes build errors locally.

We got the same error, the question for us was the previous version of the Entity Framework, left links that are no longer needed, but still cause build errors. We did not encounter problems with the assembly locally, but when trying to build on TeamCity then an error would occur.

Using the package manager console, we launched Update-Package EntityFramework -Reinstall , and this removed the link for us.

+1
source share

Using visual studio 2012, I can solve this problem by adding a link, looking at the path: C: \ Program Files (x86) \ Microsoft Visual Studio 11.0 \ Common7 \ IDE \ Extensions \ Microsoft \ Entity Framework Tools \ NuGet Packages \ EntityFramework.5.0. 0 \ lib \ net45

and then selecting the framework.dll object

0
source share

All Articles