SORU
13 Kasım 2013, ÇARŞAMBA


Razor 3 Razor 2 5 MVC

MVC 4 bir çözüm üzerinde çalışıyorum, ve MVC 5 yükseltmek için çalışıyorum. Adımları here ana hatlarıyla takip ediyorum.

Onu takip ettim, ve şimdi MVC Uygulama çalıştırmak zaman ben, bana bu hata mesajı veriyor:

[A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to 
[B]System.Web.WebPages.Razor.Configuration.HostSection. 

Type A originates from 
'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, 
PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 
'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'. 
Type B originates from 'System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, 
PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 
'C:\Users\User\AppData\Local\Temp\Temporary ASP.NET 
Files\root\665ac028\de53a189\assembly\dl3\c2c0a4b5\56e8099e_40e0ce01\System.Web.WebPages.Razor.dll'.

Herkes bu ortaya çıkmış olabileceğini nasıl biliyor mu? ya da nasıl çözülebilir? Etrafında şimdiye kadar baktım? Web değiştirmeyi denedim.yapılandırma dosyaları, boşuna

CEVAP
13 Kasım 2013, ÇARŞAMBA


Web.config(-s) assemblyBinding Kurul System.Web.WebPages.Razor System.Web.Mvc. doğru sürümü içerdiğinden emin olun

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
  </dependentAssembly>

  <dependentAssembly>
    <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
  </dependentAssembly>
</assemblyBinding>

Ve emin olun jilet ConfigSections 9 * başvuru son sürüm olarak

<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
    <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" />
    <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" />
</sectionGroup>

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • hotstrikegently

    hotstrikegen

    26 AĞUSTOS 2011
  • thetrollska

    thetrollska

    2 EKİM 2009
  • WOSU Public Media

    WOSU Public

    23 AĞUSTOS 2007