Thursday, January 24, 2013

The type 'System.Web.Mvc.ModelClientValidationRule' exists in both

I think you may have often got this error when ever you are getting started working on MVC projects. Especially this occurs when you install MVC4 framework and you have MVC3 also installed so when ever you create a MVC3 project you might get this error on building the project in AccountController class:

The type 'System.Web.Mvc.ModelClientValidationRule' exists in both '....System.Web.WebPages.dll' and '........\System.Web.Mvc.dll'    .......................AccountModels.cs

Solution:

I just wanted to tell you the simple solution for this:

Open you project .csproj file in Notepad or any other text editor and replace this line with the new line which I will show you.

Previous Line:


Replace With:


After saving the file and reloading the project and then building the project again you will get surprised that you issue got resolved automatically.

Hope this might help many developers getting this issue.


No comments:

Post a Comment