问题标签 [simplemembership]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
asp.net-mvc - How to autoCreateTables along with SimpleMembership tables in ASP.NET MVC
Today, I created a new ASP.NET MVC 4 project - Internet application.
With all the files that comes in the solution in the Account Controller I saw an attribute called [InitializeSimpleMembership]
and by only providing a proper db connectionstring property in the web.config
and when the application runs, it checks if the available database exists or not and if not creates one and adds few memebership tables to it also. I must say I was very very impressed with the new MVC 4 - Internet app template.
Which brings me to my question : I liked the idea of creating database and executing script from the application. I wanted to know how to add more tables to this.
For example : In the InitializeSimpleMembershipAttribute.cs
file it check if a database is present, if not it creates it using the credentials present in the web.config and also adds the following tables to it.
- UserProfile
- webpages_Membership
- webpages_OAuthMembership
- webpages_Roles
- webpages_UsersInRoles
what changes do I have to make to have my other tables to be added along with this ?
If this is possible, the idea of keeping sql scripts and executing them on each clean deploy can be avoided. I am working on a self-host MVC app ( It's Open-source, soon to come on Codeplex ;) ) so this will really be good for people who want to use my app without getting their hands dirty in SQL scripts.
Please can some one let me know if this is even possible. Thanks
asp.net-mvc - 如何在 Azure 网站上获取错误详细信息
我是 Azure 的新手。有人知道如何在部署到 Azure Web 的网站上获取详细的错误消息吗?
我添加SimpleMembership
到网站,现在正在显示注册和登录(帖子)
抱歉,处理您的请求时出现了一个错误。
我正在连接到家用计算机上的数据库(连接没有问题)。
LogFiles
azure ftp 服务器上的文件夹有一些文件,但我看不到如何使用这些信息。我希望我能在 azure 上获得 YellowScreen ......
sql-server - 控制 SimpleMembershipProvider 生成的表?
我发现SimpleMembershipProvider
它非常整洁和富有成效。
我想知道是否有办法控制生成表/列名/数据类型。
visual-studio-2012 - 为程序集 mstest 提供了部分绑定信息
我SimpleMembership
在.Net 中使用新框架。
创建用户的单元测试(使用 API - 见下文)在 Visual Studio 2012 IDE 中本地运行良好。
WebSecurity.CreateUserAndAccount(entity.UserName, entity.Password, new { });
但是,在构建服务器上运行时(使用 TeamCity),我得到以下信息。
我尝试过 Dependency Walker,但没有成功。我也想不出这怎么能在 x64 中运行——考虑到 VS2012 在 x86 中运行。
任何帮助,将不胜感激。
抛出异常:
asp.net-mvc - 使用 SQL Server Compact (SDF) 的 SimpleMembership - 先使用现有数据库编写代码
可能我遗漏了一些明显的东西,但我无法设法让基于 SDF 的 ASP.NET MVC 4 Web 应用程序与新的简单成员资格一起工作。我详细说明了我的步骤,因此这可以作为其他新手的参考。
首先,我发现这个对新会员系统非常有用的介绍:http ://weblogs.asp.net/jgalloway/archive/2012/08/29/simplemembership-membership-providers-universal-providers-and-the- new-asp-net-4-5-web-forms-and-asp-net-mvc-4-templates.aspx。我在现有数据库(SDF 是成熟的现有 SQL Server 数据库的临时占位符)中的代码优先步骤如下:
- 我用 VS 2012 创建了一个新的互联网应用程序。
- 我向 App_Data ( ) 添加了一个新的 SDF 文件,
Accounts.sdf
并在那里为用户和角色创建了我的表。 - 我添加了一个新的连接字符串
web.config
:
- 我将
InitializeSimpleMembershipAttribute.cs
文件更改为使用我自己的文件,该文件datacontext
托管在中间数据层中;在这里,我粘贴了我对模板代码所做的一些相关更改:
这是数据上下文(注意 default 中的连接字符串名称ctor
):
现在,当我运行 Web 应用程序时,我立即收到一个异常,告诉我LocalSqlServer
找不到连接名称。这属于 machine.config,我可以在其中找到这些条目:
因此,我试图通过将这些行添加到我的web.config
:
如果我现在运行该应用程序,我会收到如下异常:
然而,Web 应用程序引用了 VS 模板已经设置的WebMatrix.Data
和WebMatrix.WebData
(版本 2)。那么我怎么能让这个工作呢?
c# - 来自 CakePHP 家伙的 ASP.NET MVC 4 / SimpleMembership 问题
我对 ASP.NET MVC(和一般的 .NET)非常陌生。我正在尝试将一个具有一些 CRUD 功能的基本网站组合在一起,但我被 EF 和 SimpleMembership 绊倒了。我花了几个小时寻找好的入门信息,但似乎 MVC 4 太新了,没有成熟的内容(我能理解)。
现在提问!
如果我想添加一些模型,例如 Jobs 和 Applications,我应该将它们全部集中在一个单一的整体文件中,还是将每个模型分解为自己的文件?
我应该有多少数据库上下文?会是这个样子吗?
UsersContext(来自 SimpleMembership)是否应该与我为模型创建的上下文分开?
如果我想拥有从工作到用户(例如海报和接受者)的多个“导航属性”(正确使用?),我会这样做吗?
与上一个问题相关,如果我使用 SimpleMembership 并将我的模型和 UsersContext 的上下文分开(我认为我应该,如果我错了,请纠正我),我如何跨上下文边界进行引用?
回答这些问题真的会帮助我起步!谢谢!
asp.net-mvc-4 - MVC 4 SimpleMembership 使用带有 UserId Guid 的自定义模式
SimpleMembership开箱即用的默认行为是为UserId设置一个int。
有没有一种快速的方法让 SimpleMembership UserId与 GUID 一起工作?
如果不能,我可以扩展 SimpleMembership 吗?
解决此问题的最佳方法是什么?
有没有人使用由 Scott Allen 发起的MemFlex开源库取得任何成功?
c# - SimpleMembership Provider 未分配 ID
我正在尝试使用 SimpleMembership 获得一个带有 SQL 的 MVC4 站点,但是每当我创建用户记录时,我都会不断收到错误消息:
所以对我来说,这说明它试图在我的用户表中插入一行,但它没有设置“Id”属性,它是表的主键。此 ID 是提供程序要求的 int 列。以下是代码的运行方式:
Id 是一个 int 主键列,Email1 是用户名列,nvarchar(255)。
和数据库的连接字符串:
我检查了 WebSecurity.CreateUserAndAccount、SimpleMembershipProvider.CreateUserAndAccount 和 SimpleMembershipProvider.CreateUserRow 的源代码,并且在任何这些方法中,源代码都没有为用户记录分配 ID,这将确认为什么会出现异常抛出。但是该方法不允许我指定 ID,并且当此示例针对 SQLExpress 运行时,它似乎可以很好地分配 ID...所以我不确定我在这里做错了什么。
谢谢!
sql - 获得简单的会员资格以使用 azure 网站
我想使用简单的成员资格提供程序,就好像我正在连接到这个 mvc 项目的本地 mdf 文件一样,除了我想要免费的 azure 试用数据库上的成员表
连接字符串应该如何寻找建立这个连接。
当本地连接到本地 mdf 时,它的工作方式就像猫屁股,但是没有很好地记录在 azure 上构建的表。
有人做过吗?
好的,我需要确保 conn 字符串名称与传递给 Filters > InitializeSimpleMembershipAttribute.cs 文件的 WebSecurity.InitializeDatabaseConnection 方法的名称相同,默认情况下它是 DefaultConnection,因此它必须与您提供的连接字符串对齐azure db conn 字符串。
所以现在我已经从 VS 中删除了 f5 并创建了表格,我什至在本地测试了我的 facebook 登录并且它可以工作。
但是...当我将应用程序部署到 azure 网站时,该站点超时并出现 504 错误,例如无法连接到 sql,这发生在我的 Azure 中的 sql 数据库以及我启动虚拟安装了 sql 并启用了 tcp 端口 1433 的服务器 - 就像我说这在我用完 VS 时在本地工作,只是在天蓝色云上没有。
我得到错误。
处理您的请求时发生错误。
fiddler 将其显示为 504 错误网关超时。有人使用简单的登录会员 api 在 Azure 上运行 mvc 4 站点吗?
sql-server - SimpleMembership 数据库是否应该在 mvc4 中分开
MVC4代码优先应用
我将在 UseProfile 中添加两个 int16 字段,并从大约 600 个用户开始,这可能会增长。我知道如何将 SimpleMembership 配置为单独的数据库或滚入主应用程序数据库。代码明智的是,要走哪条路是一个折腾。经验丰富的开发人员对在这种情况下的最佳实践有何意见,特别是考虑到 SimpleMembership 与旧的 Membership 提供程序的缩减模式。两个数据库的最大缺点是与托管相关的成本。
谢谢,