Compiler Error Message: CS0246: when I renamed my project
asp.net, asp.net-mvc, asp.net-mvc-4, c#
Solution
When Visual Studio creates your project, it automatically adds its original namespace to `\Views\web.config`:
<system.web.webPages.razor>
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
...
...
...
<add namespace="OriginalProjectNamespace" />
</namespaces>
</pages>
</system.web.webPages.razor>
After renaming the project or changing its default namespace you must manually change it in this file.
Problem
I renamed my project and it would compile before but when I made some changes it stopped working for some reason the error is ``` Compiler Error Message: CS0246: The type or namespace name 'Lab4' could not be found (are you missing a using directive or an assembly reference?) ``` I made a new project from the template of Lab4 and renamed it to lab5 following the steps here http://petermcintyre.com/topics/using-an-app-as-a-template-asp-net-mvc/ I found the source file ``` Line 28: using Lab4; Line 29: Line 30: Source File: c:\Users\Albert\AppData\Local\Temp\Temporary ASP.NET Files\root\4b806faf\de1f1e7\App_Web_index.cshtml.a8d08dba.c_hu0onk.0.cs Line: 28 ``` of that but when I try to change the using Lab4 to lab5 and recompile it, the same error happens and that file gets deleted and a new one gets made with the same Lab4 issue. Does anyone know the answer?