How to debug ASP. net mvc using source code

Source: Internet
Author: User

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.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.