O que é esse erro no projeto ASP.NET MVC 3 RTM?
Criar novo projeto ASP.NET MVC 3 RTM e substituir referências para usar o ASP.NET MVC 3Código fonte
mas Quando executo o projeto novamente, obtenha esta exceção:
[A] System.Web.WebPages.Razor.Configuration.HostSection não pode ser convertido em [B] System.Web.WebPages.Razor.Configuration.HostSection. O tipo A é originado de 'System.Web.WebPages.Razor, versão = 1.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35' no contexto 'Padrão' no local 'C: \ Windows \ Microsoft.Net \ assembly \ GAC_MSIL \ System .Web.WebPages.Razor \ v4.0_1.0.0.0__31bf3856ad364e35 \ System.Web.WebPages.Razor.dll '. O tipo B é originário de 'System.Web.WebPages.Razor, versão = 1.0.0.0, Culture = neutral, PublicKeyToken = null' no contexto 'Padrão' no local 'C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Arquivos temporários do ASP.NET \ root \ 2505c7ee \ 369315c5 \ assembly \ dl3 \ f7bae428 \ d03eeed8_85bbcb01 \ System.Web.WebPages.Razor.DLL '.
Descrição: ocorreu uma exceção não tratada durante a execução da solicitação da web atual. Revise o rastreamento de pilha para obter mais informações sobre o erro e onde ele se originou no código.
Erro de origem:
Line 106: internal static RazorWebSectionGroup GetRazorSection(string virtualPath) {
Line 107: // Get the individual sections (we can only use GetSection in medium trust) and then reconstruct the section group
Line 108: return new RazorWebSectionGroup() {
Line 109: Host = (HostSection)WebConfigurationManager.GetSection(HostSection.SectionName, virtualPath),
Line 110: Pages = (RazorPagesSection)WebConfigurationManager.GetSection(RazorPagesSection.SectionName, virtualPath)
Arquivo de origem: E: \ GreenTour \ páginas da web \ src \ System.Web.WebPages.Razor \ WebRazorHostFactory.cs Linha: 108