我正在尝试为我的MVC3应用程序实现我的第一个自定义配置文件提供程序。
我的个人资料模型是 -
Public Class Profile
Inherits ProfileBase
Public Overridable Property FirstName As String
Public Overridable Property LastName As String
Public Overridable Property COUNTY_NUM As Integer
Public Overridable Property COUNTY_ONLY_SW As String
Public Overridable Property WORKER_TYPE_IND As String
Public Overridable Property Agency As Decimal
Public Shared Function GetProfile(userName As String) As Profile
Return DirectCast(Create(userName), Profile)
End Function
End Class
我已经实现了一个基于System.Web.Profile.ProfileProvider的默认配置文件提供程序,其中实现了所有方法,并在所有抛出中抛出异常和断点。当我单步执行GetProfile()方法时,它不会调用ProfileProvider中的任何函数。我知道我的配置文件提供程序确实被调用,因为如果web配置没有加载/查找类,我会收到错误。
我错过了一步吗?