SORU
22 ŞUBAT 2012, ÇARŞAMBA


Invalidcastexception ASP.NET MVC 4 Beta yükledikten sonra atılır

MVC 3 ASP.NET bir makinede ASP.NET MVC 4 Beta yükledikten sonra aşağıdaki özel durum alıyorum.

Sistem.Invalidcastexception kullanıcı kodu tarafından işlenmeyen Mesaj=[A]Sistemi.Web.Web sayfaları.Jilet.Yapılandırma.HostSection olamaz döküm [B]Sistemi.Web.Web sayfaları.Jilet.Yapılandırma.HostSection. Bir tür kaynaklanır 'Sistem.Web.Web sayfaları.,=1.0.0.0,=, Kültür tarafsız Razor Sürüm, PublicKeyToken=31bf3856ad364e35' 'Varsayılan' yerde bağlamında 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'. B Tipi 'System.kaynaklanan Web.Web sayfaları.Jilet,=2.0.0.0,=, Kültür tarafsız=31bf3856ad364e35 Sürüm PublicKeyToken' bu bağlamda 'Varsayılan' yerde 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'. Kaynak=Sistem.Web.Web sayfaları.Jilet

StackTrace:

Sistem.Web.Web sayfaları.Jilet.WebRazorHostFactory.GetRazorSection(String sanalyol) Sistem.Web.Web sayfaları.Jilet.WebRazorHostFactory.CreateHostFromConfig(String sanalyol, Dize physicalPath) Sistem.Web.Web sayfaları.Jilet.RazorBuildProvider.()GetHostFromConfig Sistem.Web.Web sayfaları.Jilet.RazorBuildProvider.()CreateHost Sistem.Web.Web sayfaları.Jilet.RazorBuildProvider.()EnsureGeneratedCode Sistem.Web.Web sayfaları.Jilet.RazorBuildProvider.()get_CodeCompilerType Sistem.Web.Derleme.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider) Sistem.Web.Derleme.BuildProvidersCompiler.()ProcessBuildProviders Sistem.Web.Derleme.BuildProvidersCompiler.()PerformBuild Sistem.Web.Derleme.BuildManager.CompileWebFile(Sanalyol sanalyol) Sistem.Web.Derleme.BuildManager.GetVPathBuildResultİnternal(Sanalyol sanalyol, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildİnPrecompile, Boolean throwıfnotfoundise, Boolean ensureİsUpToDate) Sistem.Web.Derleme.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext içerik, Sanalyol sanalyol, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildİnPrecompile, Boolean throwıfnotfoundise, Boolean ensureİsUpToDate) Sistem.Web.Derleme.BuildManager.GetVirtualPathObjectFactory (, HttpContext içerik, Boolean allowCrossApp, Boolean throwıfnotfoundise Sanalyol sanalyol) Sistem.Web.Mvc.BuildManagerWrapper.Sistem.Web.Mvc.İBuildManager.FileExists(String sanalyol) Sistem.Web.Mvc.BuildManagerViewEngine.FileExists(ControllerContext controllerContext, Dize sanalyol) Sistem.Web.Mvc.VirtualPathProviderViewEngine.(,`1 controllerContext Listesi ControllerContext yerleri, String name, String controllerName, Dize areaName, cacheKey String, String []&) searchedLocations GetPathFromGeneralName Sistem.Web.Mvc.VirtualPathProviderViewEngine.(ControllerContext controllerContext, String[] konumları, String[] areaLocations, Dize locationsPropertyName, String name, String controllerName, cacheKeyPrefix String, Boolean useCache, String []&) searchedLocations GetPath Sistem.Web.Mvc.VirtualPathProviderViewEngine.FindView(ControllerContext controllerContext, String viewName, masterName String, Boolean useCache) Sistem.Web.Mvc.ViewEngineCollection.&;>lt c__DisplayClassc.b__b(İViewEngine e) Sistem.Web.Mvc.ViewEngineCollection.Bul(İşlev`2 Arama, Boolean trackSearchedPaths) Sistem.Web.Mvc.ViewEngineCollection.FindView(ControllerContext controllerContext, String viewName, Dize masterName) Sistem.Web.Mvc.ViewResult.FindView(ControllerContext içerik) Sistem.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext içerik) Sistem.Web.Mvc.ControllerActionİnvoker.İnvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) Sistem.Web.Mvc.ControllerActionİnvoker.&;>lt __DisplayClass1c c.b__19() Sistem.Web.Mvc.ControllerActionİnvoker.İnvokeActionResultFilter(İResultFilter filtre, ResultExecutingContext preContext,`1 Saattir devam) Sistem.Web.Mvc.ControllerActionİnvoker.&;>lt c_DisplayClass1c._&;>lt __DisplayClass1e c.b__1b() Sistem.Web.Mvc.ControllerActionİnvoker.İnvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filtreler, ActionResult actionResult) Sistem.Web.Mvc.ControllerActionİnvoker.İnvokeAction(ControllerContext controllerContext, String actionName) Sistem.Web.Mvc.Denetleyicisi.()ExecuteCore [project_namespace].Denetleyicileri.GlobalizationController.() ExecuteCore [dosya_yolu] Sistem.Web.Mvc.ControllerBase.Yürütme(RequestContext requestContext) Sistem.Web.Mvc.ControllerBase.Sistem.Web.Mvc.İController.Yürütme(RequestContext requestContext) Sistem.Web.Mvc.MvcHandler.&;>lt c_DisplayClass6._&;>lt c__DisplayClassb.b__5() Sistem.Web.Mvc.Zaman uyumsuz.AsyncResultWrapper.&;>lt __DisplayClass1 c.b__0() Sistem.Web.Mvc.Zaman uyumsuz.AsyncResultWrapper.&;>lt c_DisplayClass8`1_.b__7(IAsyncResult _) Sistem.Web.Mvc.Zaman uyumsuz.AsyncResultWrapper.WrappedAsyncResult`1.()End Sistem.Web.Mvc.MvcHandler.&;>lt c__DisplayClasse.b__d() Sistem.Web.Mvc.SecurityUtil.b__0(Eylem f) Sistem.Web.Mvc.SecurityUtil.ProcessİnApplicationTrust(Eylem) Sistem.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) Sistem.Web.Mvc.MvcHandler.Sistem.Web.İHttpAsyncHandler.EndProcessRequest(IAsyncResult result) System at.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.İExecutionStep.()Execute Sistem.Web.HttpApplication.ExecuteStep(İExecutionStep adım, Boolean& completedSynchronously)

Bu bana tamamen engeller ve beta tutmak istiyorum, ben hariç kurtulmak için tamamen kaldırmak için ihtiyacım olabilir.

CEVAP
11 Mayıs 2012, Cuma


ASP.NET MVC MVC 3 4 ASP.NET göç aynı sorun bende de vardı ama. Bu şekilde bu konu üzerinde aldım. Bu sorun için bir çözüm bulduk, ama onun kaynağı farklıdır, WebPages Sürüm değil.

Resmi kılavuzu (bunu söylemek) Upgrading an ASP.NET MVC 3 Project to ASP.NET MVC 4 takip ettim.

Bu sorunu gidermek için, Web Ekle.Config (muhtemelen önceden eklenmiş olanlar):

<runtime><!-- Should be there by default, near end -->
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><!-- Should be there by default -->
    <dependentAssembly>..</dependentAssembly><!-- Should be there by default -->
        ... some other dependecy redirects ...

    <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages.Razor"
            publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0"/>
    </dependentAssembly>

        ... some other dependency redirects ...
    </assemblyBinding>
</runtime>

Notları da Sistemi değiştirmek için Başvuru söz konusu değil.Web.2.0.0.0 1.0.0.0 dan yardımcıları (ve yeni bir ekleme).

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

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Sali Kaceli

    Sali Kaceli

    24 ŞUBAT 2009
  • Tomas N

    Tomas N

    14 Kasım 2010
  • Top10Series

    Top10Series

    26 Kasım 2008