Google Analytics İzleme

23 Ağustos 2012

MVC 3 - Visual Studio 2012'yi yükledikten sonra System.Web.Mvc.ModelClientValidationRule çakışma hatası

Bugün Visual Studio 2012'yi kurdum.
Eski deneme projelerinden birinde eski sürüm Visual Studio 2010 ile açıp, derleme yapınca aşağıdaki gibi hata aldım.


Oluşan hata:

Error 1 The type 'System.Web.Mvc.ModelClientValidationRule' exists in both 'c:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v2.0\Assemblies\System.Web.WebPages.dll' and 'c:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.Web.Mvc.dll' C:\Users\ishak.kulekci\Desktop\temp7\progressiveenhancement\ProgressiveEnhancement\Models\AccountModels.cs 242 43 ProgressiveEnhancement

Çözüm:
Aşağıdaik MVC 3 dll'lerini projede silip, tekrar referans olarak eklendiğinde sorun düzelmektedir.

System.Web.Helpers
System.Web.Mvc
System.Web.WebPages

UygulamaProjeAdi.csproj dosyasına bakılınca şu görünüyordu:

<ItemGroup>
...
<Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
    <Reference Include="System.Web.WebPages" />
    <Reference Include="System.Web.Helpers" />
...
</ItemGroup>


Güncelleme yaptıktan sonraki görünüm:

<Reference Include="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
    <Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />

Kaynaklar:
http://www.asp.net/whitepapers/mvc4-release-notes#_Toc303253815
http://stackoverflow.com/questions/8512021/build-errors-system-web-mvc-modelclientvalidationrule-conflicts
http://stackoverflow.com/questions/9471263/mvc-4-beta-side-by-side-installation-error


Hiç yorum yok: