Mr Lahey
Mr Lahey

Reputation: 676

Deploying ASP.NET MVC2 app Issue

I'm trying to deploy my new ASP.NET MVC 2.0 website to our Windows Server 2008 box and having some issues.

I created a new website in IIS, made sure the application pool was set to Integrated. When I browse to the website I get the following error.

Server Error in '/' Application.

Configuration Error 
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

Parser Error Message: Could not load file or assembly 'System.Web.Mvc, Version=2.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)

Source Error: 


Line 17:         validateRequest="false"
Line 18:         pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
Line 19:         pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
Line 20:         userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
Line 21:       <controls>

Line 19 is the offending line. I tried Googling, but I can't find the issue related with MVC, just other apps.

I tried setting the MVC related DLLs to copy locally, but that had no effects. The DLLs in my bin are:

System.Web.Abstractions.dll
System.Web.Mvc.dll
System.Web.Routing.dll
MyWebsite.dll

In case it matters the site is pretty plain. There is no real logic in it yet outside the default login and registration that comes with an MVC app. Its just views really.

Upvotes: 1

Views: 552

Answers (2)

Artur Kedzior
Artur Kedzior

Reputation: 4263

You don't need to install MVC2 on the server in order to run it. You can do Bin Deployment by setting properties Copy Local to true of these references:

System.ComponentModel.DataAnnotations.dll

System.Web.Mvc.dll

If you are running .NET Framework 3.5 NOT .NET Framework 3.5 SP1 change properties for all these.

System.ComponentModel.DataAnnotations.dll

System.Web.Abstractions.dll

System.Web.Mvc.dll

System.Web.Routing.dll

Anyway I wrote step by step tutorial how to configure server and deploy MVC2 application

http://arturito.net/2011/01/21/publishing-asp-net-mvc2-application-on-windows-server-2008-iis-7-with-visual-studio-2008-on-platform-net-3-5-sp1/

Upvotes: 1

Matt Sherman
Matt Sherman

Reputation: 8358

Any chance you are upgrading from MVC version 1.0? You might want to check the version # on the dll itself.

Running the MVC installer on the server would probably help too.

Upvotes: 2

Related Questions