我有一个ASP.NET MVC 2网站(VS2010),我已经升级到ASP.NET MVC 3(VS2012),这在本地IIS7上工作,但发布时,我在主机上得到这个异常:
Could not load file or assembly 'System.Web.WebPages,Version=2.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
在一些seartch之后,我发现this表示我应该在一些引用(包括System.Web.WebPages)上设置CopyLocal,并且还使用VS2012中的发布工具,但是这会产生以下异常?@H_403_5@
Could not load file or assembly 'System.Web.WebPages.Deployment,PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
我找不到任何部署DLL来设置copyLocal?@H_403_5@
解决方法
读了
http://joel.net/getting-asp.net-mvc-3-working-on-discountasp.net
您需要添加对System.Web.WebPages.Deployment的引用,并将其设置为CopyLocal.@H_403_5@