【发布时间】:2013-01-29 01:18:22
【问题描述】:
我正在尝试将SimpleMembershipProvider 与 SQLite 一起使用以在我的网站上启用身份验证。我在我的Global.aspx 中对其进行了初始化并且可以创建用户,但是我无法登录用户。当我尝试调用WebSecurity.Login([UserName], [Password]) 时出现以下错误:
Cannot implicitly convert type 'long' to 'int'. An explicit conversion exists (are you missing a cast?)
堆栈跟踪如下(在我调用Login函数后:
CallSite.Target(Closure , CallSite , Object ) +146
System.Dynamic.UpdateDelegates.UpdateAndExecute1(CallSite site, T0 arg0) +661
WebMatrix.WebData.SimpleMembershipProvider.VerifyUserNameHasConfirmedAccount(IDatabase db, String username, Boolean throwException) +315
WebMatrix.WebData.SimpleMembershipProvider.ValidateUser(String username, String password) +162
WebMatrix.WebData.WebSecurity.Login(String userName, String password, Boolean persistCookie) +32
我知道 SQLite 只允许在数字列中使用 Int64 值(不是 float)。问题是:如何让 SimpleMembershipProvider 与 Int64 值一起使用?我查看了堆栈跟踪中列出的违规例程的源代码,似乎所有数字在从它们的Int32 函数返回之前都被显式转换。但是,我没有System.Dynamic.UpdateDelegates.UpdateAndExecute1 或CallSite.Target 的来源,所以我看不到那里发生了什么。更重要的是,这些可能是预编译的。所以,问题仍然存在,我怎样才能让它工作?
【问题讨论】:
标签: asp.net-membership membership-provider webmatrix simplemembership webmatrix-2