Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not load assembly WebPages.Deployment version 2 at host?

I have a ASP.NET MVC 2 website (VS2010) that I have upgraded to ASP.NET MVC 3 (VS2012) and this works fin on local IIS7 but when publishing it I get this exception on host :

 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.

After some seartch I found this that states that I should set CopyLocal on some of the references(inlcuding the System.Web.WebPages) and also use the publish tool in VS2012, but this generated the following exception?

Could not load file or assembly 'System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

And I can´t find any Deployment dll to set copyLocal?

How could I solve this?

like image 627
Ivy Avatar asked Jul 06 '12 09:07

Ivy


1 Answers

Have a read of http://joel.net/getting-asp.net-mvc-3-working-on-discountasp.net

You need to add a reference to System.Web.WebPages.Deployment and set that also to CopyLocal.

like image 134
magritte Avatar answered Oct 24 '22 12:10

magritte