After creating a new project, remove System.web.mvc.dll and re-select local C:\Program Files (x86) \microsoft Asp.net\asp.net MVC 4\ Assemblies under the System.web.mvc.dll, compile a problem prompt: "The type or namespace name ' Html ' does not exist in the namespace ' SYSTEM.WEB.MVC ‘”
Switch back the problem still occurs with the System.web.mvc.dll under the new application directory.
To have the view recompile:
1,) modify the Web solution. csproj file,
1.1,) Set the Mvcbuildviews property to True;
< mvcbuildviews >true</mvcbuildviews>
1.2,) Add the following to the </Project> front:
1 <!--to modify your build process, add your task inside one of the targets below and uncomment it.2 Other similar extension points exist, see Microsoft.Common.targets.3 <target name= "BeforeBuild" >4 </Target>5 <target name= "Afterbuild" >6 </Target> -7 <TargetName= "Mvcbuildviews"aftertargets= "Afterbuild"Condition= "' $ (mvcbuildviews) ' = = ' true '">8 <AspNetCompilervirtualpath= "Temp"PhysicalPath= "$ (webprojectoutputdir)" />9 </Target>Ten </Project>
, and then recompile, the problem is solved.
ASP. NET Mvc4 when you set up the build project, compile the view page