MVC4 deployment could not load file or assembly System.web.http.webhost or other file error

Source: Internet
Author: User
Tags webhost

More and more programmers have been using it since the release of VS2010, many of whom use MVC as a new development framework, but we also have a lot of problems when it comes to system deployment, because most Windows servers currently use Windows Server 2003, so we need to install a high version of the. NET Framework 3.5 or 4.0 on the server to keep our system running.

Next we deploy the. NET Framework 4.0 MVC application System, first installing the. NET Framework 4.0 on the server, but often encountering an error when installing, which is to install Microsoft's Windows Imaging components ( WIC), this is very simple, we just download to the official website of Microsoft, install WIC and continue to install the. NET Framework 4.0 is OK.

Deploying the system, like the. NET Framework 2.0 application deployment, just select the. NET Framework 4.0 when you finally select the ASP.

Visit website address, often encounter an error, Could not load file or assembly ' SYSTEM.WEB.MVC, version=2.0.0.0, .... "

Analyzed under the reason that ' SYSTEM.WEB.MVC 2.0 is released with VS2010, generally and is located in C:/Program files/microsoft asp.net/asp.net MVC 2/assemblies/ System.Web.Mvc.dll, so we have to do some work on the reference when we use it.

The most convenient is to put the System.Web.Mv.dll file in the system's Bin directory, but this regeneration or do SVN synchronization when it is inconvenient, give a method:

1. You can create a folder in your project to hold a. dll that references a third party

2. Copy the System.web.mvc.dll to this folder

3. Change the Web project reference to this DLL to System.web.mvc.dll in the folder

4. Set the "Copy Local" property to True for the DLL. This can be done by browsing to the WEB project in the References folder by clicking the SYSTEM.WEB.MVC pull-up property, selecting "Properties" Copy Local "and ensuring that it is set to true.

This will not miss the dynamic library every time it is released or regenerated.

Problem solving, deployment success!

MVC4 deployment could not load file or assembly System.web.http.webhost or other file error

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.