我正在尝试使用SimpleMembershipProviderSQLite 在我的网站上启用身份验证。我已将其初始化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.UpdateAndExecute1or的来源CallSite.Target,所以我看不到那里发生了什么。更重要的是,这些可能是预编译的。所以,问题仍然存在,我怎样才能让它工作?