Visual Studio 2013 C# Web Project builds but IDE reports The type or namespace name xxx could not be found error

后端 未结 10 2173
攒了一身酷
攒了一身酷 2020-12-04 16:56

When opening an MVC4 C# web project in Visual Studio 2013, the IDE reports the error \"The type or namespace name \'_\' could not be found (are you missing a using

相关标签:
10条回答
  • 2020-12-04 17:31

    Try to unload the project in VS2013, then right click the node and select edit "projectname.csproj". Check the individual references they might point to somewhere strange.

    EDIT: the csproj file is an xml file and the references are located under Project -> ItemGroup -> Reference

    0 讨论(0)
  • 2020-12-04 17:34

    Microsoft just released a new security update to be automatically applied to machines configured to use Microsoft Update.

    Unfortunately, some ASP.NET MVC 3 and 4 VS projects can no longer build after the update is applied. These projects will fail with the following error:

    "Could not locate the assembly "System.Web.Mvc,Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35,processorArchitecture=MSIL"

    My project also had the error "The type or namespace name 'System.Web.Mvc' could not be found (are you missing a using directive or an assembly reference)". Installing the latest version of Microsoft.AspNet.Mvc solved my problem. See the following article from Microsoft for more info:

    http://blogs.msdn.com/b/webdev/archive/2014/10/16/microsoft-asp-net-mvc-security-update-broke-my-build.aspx

    0 讨论(0)
  • 2020-12-04 17:38

    Same issue. Opening the project's properties and making a change to the name (or any value) and then rebuilding seems to have resolved it.

    0 讨论(0)
  • 2020-12-04 17:40

    There's a known issue with Web Application projects when bound to a TFS server that sounds like this issue. This occurs when the following TFS setting option is checked:

    Options -> Source Control -> Environment -> Get everything when a solution or project is opened.

    Disabling this option resolves the problem.

    thanks, Miguel Lacouture [MSFT]

    0 讨论(0)
提交回复
热议问题