Error:
The type 'System.Web.Mvc.ModelClientValidationRule' exists in both 'd:\Program Files\Microsoft ASP.NET\ASP.NET Web Pages\v2.0\Assemblies\System.Web.WebPages.dll' and 'd:\Program Files\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.Web.Mvc.dll
Resolution:
Issue resolved as per http://www.asp.net/whitepapers/mvc4-release-notes#_Toc303253815
Methods (Copied from http://www.asp.net/whitepapers/mvc4-release-notes#_Toc303253815 for reference):
The type 'System.Web.Mvc.ModelClientValidationRule' exists in both 'd:\Program Files\Microsoft ASP.NET\ASP.NET Web Pages\v2.0\Assemblies\System.Web.WebPages.dll' and 'd:\Program Files\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.Web.Mvc.dll
Resolution:
Issue resolved as per http://www.asp.net/whitepapers/mvc4-release-notes#_Toc303253815
Methods (Copied from http://www.asp.net/whitepapers/mvc4-release-notes#_Toc303253815 for reference):
- In the root Web.config file, add a new <appSettings> entry with the key webPages:Version and the value 1.0.0.0.
- In Solution Explorer, right-click the project name and then select Unload Project. Then right-click the name again and select Edit ProjectName.csproj.
- Locate the following assembly references:
<Reference Include="System.Web.WebPages"/> <Reference Include="System.Web.Helpers" />
Replace them with the following:<Reference Include="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL "/> <Reference Include="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
- Save the changes, close the project (.csproj) file you were editing, and then right-click the project and select Reload.
<appSettings> <add key="webpages:Version" value="1.0.0.0"/> <add key="ClientValidationEnabled" value="true"/> <add key="UnobtrusiveJavaScriptEnabled" value="true"/> </appSettings>
No comments:
Post a Comment