1

I moved my existing ASP .NET web sites and web applications to a new server, and I'm getting the following error:

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.

I located this assembly on my computer, and copied it to the BIN folder of my web site. It gives a new error:

Could not load file or assembly 'System.Web.WebPages.Deployment, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Does this mean ASP .NET is not properly installed on the server machine? How do I go about fixing this? I also noticed that the assembly is present on my computer somewhere in the Program Files (x86)/Microsoft ASP.NET folder. However, the Program Files (x86)/Microsoft ASP.NET folder does not exist on the server.

Mehdi Maujood
  • 401
  • 5
  • 14

2 Answers2

2

Solution: I installed both ASP .NET Web Pages and ASP.NET MVC 4 on the server. This installed the missing assemblies and created the folders that were missing.

Mehdi Maujood
  • 401
  • 5
  • 14
0

The exceptions speak for themselves: Your project has referenced version 2.0.0.0 of this assembly and you have copied version 1.0.0.0

Find the correct version and you'll be OK

Alireza
  • 4,976
  • 1
  • 23
  • 36
  • Actually, I did copy the 2.0.0.0 version, which is why I'm surprised too. I think this may have something to do with the fact that the Program Files (x86)/Microsoft ASP.NET folder is missing from the server. – Mehdi Maujood Jul 22 '14 at 11:21
  • I think that folder is created by visual studio, so it's absent on the server. Can you check if you copied the correct assembly? And if so, use `Process Monitor` to find where ASP.NET is looking for it? – Alireza Jul 22 '14 at 11:33
  • Will try Process Monitor, thank you. As for the folder, I can see it's present on my original server, but not on the new server. Visual Studio is not installed on any of the servers so it can't be a VS folder. – Mehdi Maujood Jul 22 '14 at 11:39
  • 1
    This may help: http://stackoverflow.com/questions/8708046/how-do-i-deploy-an-asp-net-mvc3-application – Alireza Jul 22 '14 at 12:21
  • 1
    And I think this is what you should install: http://www.microsoft.com/en-us/download/details.aspx?id=15979&751be11f-ede8-5a0c-058c-2ee190a24fa6=True – Alireza Jul 22 '14 at 12:25
  • 1
    Thank you for your help - There was some helpful information there. I will try installing that and get back to you. – Mehdi Maujood Jul 22 '14 at 12:43
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/57831/discussion-between-mehdi-maujood-and-alireza). – Mehdi Maujood Jul 23 '14 at 11:43
  • The solution: Installed both ASP.NET Web Pages and ASP.NET MVC 4 on the server. This installed the missing assemblies and created the folders I mentioned. – Mehdi Maujood Jul 23 '14 at 12:30