I recently learned the source code of asp.net mvc. When the original System. Web. Mvc in my project is removed from the System. Web. mvc compiled by the Mvc source code, an error is often encountered.
The error message is as follows:
C: \ Users \ majiang \ AppData \ Local \ Temp \ Temporary ASP. NET Files \ root \ 7aaf28bd \ 6dc92822 \ App_Web_index.cshtml.a8d08dba.luksia4z.0.cs (29): error CS0433: Type "System. web. mvc. webViewPage <TModel> "also exists in" c: \ Windows \ Microsoft. NET \ assembly \ GAC_MSIL \ System. web. mvc \ v4.0 _ 3.0.0.0 _ 31bf3856ad364e35 \ System. web. mvc. dll and c: \ Users \ majiang \ AppData \ Local \ Temp \ Temporary ASP. NET Files \ root \ 7aaf28bd \ 6dc92822 \ assembly \ dl3 \ 7186f4ca \ adb65958_7786cd01 \ System. web. mvc. DLL"
In System. Web. Compilation. AssemblyBuilder. Compile ()
In System. Web. Compilation. BuildProvidersCompiler. extends mbuild ()
In System. Web. Compilation. BuildManager. CompileWebFile (VirtualPath virtualPath)
In System. Web. Compilation. BuildManager. GetVPathBuildResultInternal (VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
In System. Web. Compilation. BuildManager. Compile (HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
In System. Web. Compilation. BuildManager. GetVirtualPathObjectFactory (VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound)
Solution:
Modify web. config in the root directory,
Of course, you can also change the PublicKeyToken used in System. web. Mvc in Web. config to null without comments.