Tips and Tricks in a world of Mix

Upgrade to MVC2

 

Well , the problem I’ve met was moving to a new computer.

All of a sudden my development project , that has been upgraded from MVC1 to MVC2 months ago , suddenly refused to work . My new computer never had the installation of MVC1. (You can check if the GAC is familiar with MVC1)

 

I’ve got message saying that I’ve got MVC1 references in my project :

 ScreenShot004

The stack trace was :

ScreenShot005

So I started looking for MVC1. Well after a little wild I found this :

ScreenShot006

Through Red Gate’s .Net Reflector I opened a suspicious  .dll in this mortal sin , and found out that the Mvc it references is MVC1. Also in their site it said :

Important: xVal is recommended for use only with ASP.NET MVC 1.0

If you’re using ASP.NET MVC 2.0 or later, the framework has built-in support for generating client-side validation logic directly from model metadata. You can still use xVal if you wish, but it won’t be actively developed or supported.

http://xval.codeplex.com/

My solution was

to download latest version  the source code from codeplex.com from http://xval.codeplex.com/SourceControl/list/changesets

Upgraded solution to VS2010 , removed MVC1 reference , added MVC2 reference , recompiled xVal.dll and all the projects using xVal.dll such as in my case xVal.RulesProviders.CastleValidator.dll and xVal.RulesProviders.NHibernateValidator.dll .

ScreenShot007

In my solution removed the old dll’s and added the new ones. For the double check opened with Reflector to see the MVC reference :

ScreenShot009

 

ScreenShot010

 

As you can see also the xVal and the derivatives are familiar with MVC2 only now.

 

The same story was with MVCContrib.dll :

 

ScreenShot012

 

For it I’ve just downloaded the new binaries from http://mvccontrib.codeplex.com/releases – the MVCContrib.release.zip .

 

From there on worked like a charm.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Tag Cloud

%d bloggers like this: