Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Suddenly missing System.Web.Mvc in my project and can't compile

Posted on 2014-10-18
1
Medium Priority
?
7,196 Views
Last Modified: 2014-10-19
I am using Visual Studio Premium 2013. I have been working on several different C# projects, and joined them all into one main solution. The main project is a C# Razor MVC project. One of the projects was configured for .Net 4.5, but the others were configured for .Net 4.0. So I raised them all to .Net 4.5, After that was done I ran the command: "Update-Package" in the Nuget Console, updating all references.

All looked nice, but I hadn't restarted Visual Studio yet. After I did that I couldn't compile because I was according to Visual Studio missing System.Web.Helpers and near everything that was referenced into the different projects. So I manually added many of the missing references as extensions in the projects, and I ran the following command in the Nuget console:
"Install-Package microsoft-web-helpers." I was now rid of the System.Web.Helpers error, and intellisense wasn't complaining anymore. When I then tried to compile the whole thing, i got(translated from norwegian);

Serverfault in the program.
Compilation error.

Description: An error occurred during the compilation of a resource required to service this request should work. Please review the specific error details below and modify your configuration file.

Compiler Error Message: CS0234: The type or namespace name Ajax does not exist in the namespace System.Web.Mvc (Maybe you lack a collection reference?)

Source error:


Line 29:         <add namespace="System.Web.Helpers" />
Line 30:         <add namespace="System.Web.Mvc" />
Line 31: 		<add namespace="System.Web.Mvc.Ajax" />   <---- This one.
Line 32:         <add namespace="System.Web.Mvc.Html" />
Line 33:         <add namespace="System.Web.Routing" />

Source file: c:\Users\name\Documents\stash_prosjects\myProject\Web.config    Line: 31 

Missing System.Web.Mvc.Ajax

Open in new window


The System.Web.Mvc namespace is added as a reference, I have verified it, and it also always has been. I guess there has happened some configuration error when I changed the .Net version configuration to 4.5? What to do? Set everything back to 4.0? I notice that I can't navigate to ANY of my usings anymore with F12. Pressing F12 on System.Web.Mvc.Ajax gives me the error: cannot navigate to Ajax. The same is for using MySql.Data.MySqlClient; cannot navigate to MySqlClient.
0
Comment
Question by:itnifl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 2

Accepted Solution

by:
itnifl earned 0 total points
ID: 40390124
The solution was extremely simple. Weird no one here went for any free points.

http://msdn.microsoft.com/en-us/library/t1zz5y8c(v=vs.90).aspx

I had to set the System.Web.Mvc reference to copy local.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

722 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