MVC 4 RC - aspnet_regsql.exe的 [英] MVC 4 RC - Aspnet_regsql.exe

查看:200
本文介绍了MVC 4 RC - aspnet_regsql.exe的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用MVC 4 RC默认模板启用登录。
我也用同样的方式在MVC 3,aspnet_regsql.exe的 - > SQL服务器。然后我做了连接字符串点到SQL服务器。

I'm trying to enable login using the MVC 4 RC default template. I did it the same way as in MVC 3, Aspnet_regsql.exe -> SQL server. Then I made the connection string point to the SQL server.

当我尝试注册一个新用户,我得到这样的:

When I try to register a new user I get this:

Server Error in '/' Application.

Invalid column name 'ApplicationId'.
Invalid column name 'UserName'.
Invalid column name 'ApplicationId'.
Invalid column name 'UserId'.
Invalid column name 'UserName'.
Invalid column name 'IsAnonymous'.
Invalid column name 'LastActivityDate'.

错误的AccountController:

Error in AccountController:

              Line 85: // Attempt to register the user
              Line 86: MembershipCreateStatus createStatus;
Error here -> Line 87: Membership.CreateUser(model.UserName, model.Password, model.Email, passwordQuestion: null, passwordAnswer: null, isApproved: true, providerUserKey: null, status: out createStatus);
              Line 88:
              Line 89: if (createStatus == MembershipCreateStatus.Success)

我一直在努力,到目前为止谷歌这个错误,但没有运气。
有没有,也许我应该在MVC 4做一些这方面的其他方式?

I've been trying to google this error but no luck so far. Is there maybe some other way I should be doing this in MVC 4?

推荐答案

我,因为我是从使用 aspnet_regsql.exe的 2.x版会员表收到同样的错误我跑在2.x版的文件夹中的 aspnet_regsql.exe的可执行文件和卸载表。然后用你不新的通用提供商需要当您连接到在第一时间再使用上面的可执行文件,创建表。

I received the same error because I was using membership tables from aspnet_regsql.exe version 2.x. I ran the aspnet_regsql.exe executable in the version 2.x folder and uninstalled the tables. Then with the new universal providers you dont need to use the above executable anymore, the tables are created when you connect to the first time.

这条进入的VS通用提供商老aspnet_Memembership之间差异的更多细节。

This article goes into more detail of the differences between the old aspnet_Memembership vs the Universal Providers.

更强的密码Hasing净

从文章的要点:

首先,的 aspnet_regsql ,你只需要确保您的连接字符串设置和帐户具有DBO权限(不用担心,它不必留这种方式)然后运行该应用并尝试执行这应该引​​起的成员资格提供打DB任何行动(即登录 - 没关系存在不是帐户) 。

Firstly, there’s no more aspnet_regsql, you just make sure your connection string is set and the account has DBO rights (don’t worry, it doesn’t have to stay this way) then run the app up and attempt to perform any action which should cause the membership provider to hit the DB (i.e. log on – it doesn't matter that there isn't an account).

这就是这一切就是这么简单。

Thats it all there is to it.

这篇关于MVC 4 RC - aspnet_regsql.exe的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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