简体   繁体   English

尝试创建用户时Web SIte管理工具出错

[英]Error in Web SIte Administration tool when trying to create user

Hi, I am trying to use the default asp.net membership provider in asp.net mvc 4 but it seems to be failing when connecting to the database. 嗨,我正在尝试在asp.net mvc 4中使用默认的asp.net成员资格提供程序,但在连接到数据库时似乎失败了。 Here are the settings I have made in web.config: 以下是我在web.config中进行的设置:

<add name="MembershipConnectionString" connectionString="Data
Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\aspnetdb.mdf;Integrated
Security=True" providerName="System.Data.SqlClient"/>

 <membership>
  <providers>
    <clear/>
    <add  name="AspNetSqlMembershipProvider"
          type="System.Web.Security.SqlMembershipProvider"
          connectionStringName="MembershipConnectionString"
          enablePasswordRetrieval="false"
          enablePasswordReset="true"
          requiresQuestionAndAnswer="false"
          requiresUniqueEmail="false"
          maxInvalidPasswordAttempts="5"         
          minRequiredNonalphanumericCharacters="0"
          passwordAttemptWindow="10"
          applicationName="/"
          passwordFormat="Hashed"
         />
  </providers>
</membership>

I should mention that I upgraded the database generated from asp.net regex to my current SQL Server when I added the connection. 我应该提一下,当我添加连接时,我将从asp.net regex生成的数据库升级到我当前的SQL Server。

Now when I try to open the ASP.NET Web Site Adminstration Tool and I go to security and tried to create a user or a role I got this error: 现在,当我尝试打开ASP.NET网站管理工具并转到安全性并尝试创建用户或角色时,我收到此错误:

The following message may help in diagnosing the problem: 以下消息可能有助于诊断问题:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. 建立与SQL Server的连接时发生与网络相关或特定于实例的错误。 The server was not found or was not accessible. 服务器未找到或无法访问。 Verify that the instance name is correct and that SQL Server is configured to allow remote connections. 验证实例名称是否正确,以及SQL Server是否配置为允许远程连接。 (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) at System.Web.Administration.WebAdminPage.CallWebAdminHelperMethod(Boolean isMembership, String methodName, Object[] parameters, Type[] paramTypes) at ASP.security_users_adduser_aspx.PopulateCheckboxes() in c:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\ASP.NETWebAdminFiles\\Security\\Users\\addUser.aspx:line 28 at ASP.security_users_adduser_aspx.Page_Load() in c:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\ASP.NETWebAdminFiles\\Security\\Users\\addUser.aspx:line 22 at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) (提供者:SQL网络接口,错误:26 - 指定服务器/实例的错误)在System.Web.Administration.WebAdminPage.CallWebAdminHelperMethod(布尔isMembership,String methodName,Object []参数,类型[] paramTypes)处于ASP.security_users_adduser_aspx。 PopulateCheckboxes()位于c:\\ Windows \\ Microsoft.NET \\ Framework64 \\ v4.0.30319 \\ ASP.NETWebAdminFiles \\ Security \\ Users \\ addUser.aspx:第28行,位于c:\\ Windows \\ Microsoft.NET中的ASP.security_users_adduser_aspx.Page_Load() \\ Framework64 \\ v4.0.30319 \\ ASP.NETWebAdminFiles \\ Security \\ Users \\ addUser.aspx:System.Web.UI.Control.OnLoad上的System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender,EventArgs e)第22行(​​EventArgs) e)System.Web.UI.Page.ProcessRequestMain上的System.Web.UI.Control.LoadRecursive()(Boolean includeStagesBeforeAsyncPoint,Boolean includeStagesAfterAsyncPoint)

What am I doing wrong? 我究竟做错了什么?

Are you sure datasourse is correct ? 你确定数据是否正确? because looks like problem is not with membership but it is unable to find server.so you should check with connection string first. 因为看起来像问题不是成员资格但它无法找到server.so你应该首先检查连接字符串。 try to connect to database without membership first then if done,you can go further. 尝试连接到没有成员资格的数据库然后如果完成,你可以更进一步。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM