简体   繁体   中英

“ 'Title' is not a member of 'ASP.views … ” in ASP.NET MVC2 VB.NET Application

I'm getting an odd compilation error in an ASP.NET MVC 2 application using VB.NET:

Description : An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message : BC30456: 'Title' is not a member of 'ASP.views_ ...

Source:

<%@ Page Title="" Language="VB" MasterPageFile="~/Views/Shared/Site.Master" ...

Oddly, this error only happens when I host the site on IIS 5.1 (WinXP) and not on Cassini. It also doesn't happen on every page. It fails on the Index.aspx page referenced above, but succeeds on a dummy page I created call foo.aspx that uses the same <% Page Title="" ... syntax. In summary:

File                 IIS 5.1             Cassini
    MyModel/Index.aspx                   OK
    Home/Foo.aspx        OK                  OK

EDIT: Now I'm getting it to fail in Cassini as well...odd

I have two questions related to this problem:

  1. Why am I getting this compilation error?
  2. Is there a work-around so that I can avoid this error?

I just came across this problem in a project I'm working on. In my case it was because the 'Inherits' referred to a type which didn't exist.

Try browsing around the Object Explorer to make sure you've got your class name exactly right.

Go into the property pages of the deployment project. Under the Compilation tab, uncheck the option "Allow this precompiled site to be updatable". This resolved the problem for me.

the same happens when I host the site on IIS 7. i had a renamed copy of the same form in the project,both inherits same name. Then I deleted the old(renamed) form and now works fine.

You will probably have lots of issues running MVC on IIS 5.1

The lack of support for wildcard filters is a bit of an issue with MVC routes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM