从Asp.net MVC 2升级到RC 3后ASPX页面将不会加载 [英] Aspx pages will not load after upgrading from Asp.net MVC 2 to 3 RC

查看:175
本文介绍了从Asp.net MVC 2升级到RC 3后ASPX页面将不会加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我升级到Asp.net MVC 3 RC昨天晚上,我跟着上发布说明中的指示。然而,在正常ASPX页面不再起作用。

I upgraded to Asp.net MVC 3 RC last night and I followed the instructions on the release notes. However, normal Aspx pages no longer work.

例如,当我去根(家庭/索引),出现以下错误:

For example, when I go to the root (Home/Index), the following error occurs:

The view at '~/Views/Home/Index.aspx' must derive from ViewPage, ViewPage<TModel>, ViewUserControl, or ViewUserControl<TModel>.

这是使用原始的MVC首页/索引视图的几乎没有修改过的版本。在code是:

This is using a barely modified version of the original MVC Home/Index view. The code is:

<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Home Page
</asp:Content>

<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
    <h2><%= Html.Encode(ViewData["Message"]) %></h2>
    <p>
        <%= Html.ActionLink("Project List", "List", "Project", new { area = "writing" }, null) %>
    </p>
</asp:Content>

这是设置为自ViewPage继承,所以我不知道问题是什么。

It is setup to inherit from ViewPage, so I'm not sure what the issue is.

母版页是什么MVC安装修改。

The master page is unmodified from what MVC installs.

任何想法?

推荐答案

请确保您的web.config有

make sure you web.config has

<assemblies>
    <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <add assembly="WebMatrix.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  </assemblies>

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

,以及在任何地区/ Web.config中

as well as in any Areas/Web.config

更新他们根据需要,你应该得到一个更好的地方。

Update them as needed and you should get to a better place

这篇关于从Asp.net MVC 2升级到RC 3后ASPX页面将不会加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆