我使用 Visual Studio 2013 制作了一个 Web 表单项目。我没有更改身份验证设置。
当我查看 web.config 文件时,我看到这句话:
ASP.NET Membership is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
当我查看此网站时,我仍然找不到填写我的提供商的方法。
我可以为每个提供程序添加此 xml 输入(默认、成员资格、角色和默认 session )
<providers>
<add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
</providers>
或者 Visual Studio 2013 中的身份框架是否发生了变化? (欧文)?
最佳答案
默认情况下,在 Visual Studio 2013 中创建新项目时,它使用新的 ASP.NET Identity。这不使用您习惯的成员(member)提供商或个人资料提供商。所以不,您不能只添加该配置数据。
如果需要,您可以将它们添加回来,但请注意,这些内容今后可能不再受支持。它们仍然有效,但不会继续进行新的开发。
如果您选择使用新的身份模型,那么您必须考虑到旧的成员(member)资料系统旨在解决成员(member)模型脆弱且不易扩展的问题。 ASP.NET Identity 的情况并非如此,您可以扩展用户类以提供原本会进入旧成员资格提供程序系统中的配置文件的信息。
但是,为了完成这项工作,您必须了解有关 ASP.NET Identity 及其工作原理的更多信息,因为这里的帖子要介绍的内容太多了。您可以从您提到的链接开始。您还可以在 http://www.asp.net/aspnet/overview/authentication-and-identity 找到更多信息
关于asp.net - "ASP.NET Membership is disabled in this template"- vs2013 Web 表单模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21516742/