在 asp.net 中使用 HDI 成员资格提供程序时出现问题

发布于 2024-12-06 01:49:08 字数 2182 浏览 0 评论 0原文

我正在尝试使用 HDI 自定义成员资格提供程序,在使用 web.config 设置后,当我运行该应用程序时,它会给出一个错误,如下所示。

我不知道我哪里出了问题?有人能指出我正确的方法吗?

Failed to map the path '/'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: Failed to map the path '/'.

这是我的 web.config:

<configuration>
  <connectionStrings>
    <add name="HDIConnectionString" providerName="System.Data.SqlClient" connectionString="Data Source=.\sqlexpress;Initial Catalog=HDIMembershipProvider;Integrated Security=True"/>
  </connectionStrings>
  <system.web>
    <membership defaultProvider="HDIMembershipProvider" userIsOnlineTimeWindow="15">
      <providers>
        <clear/>
        <add name="HDIMembershipProvider" type="HDI.AspNet.Membership.HDIMembershipProvider" connectionStringName="HDIConnectionString" enablePasswordRetrieval="true" enablePasswordReset="true" requiresQuestionAndAnswer="true" writeExceptionsToEventLog="false"/>
      </providers>
    </membership>
    <machineKey validationKey="34A0AF973A6817E4F7067DA1486E93AD5F7466B65D32405DB50766FDF335304F499C7B1943C084C7A67B1375D196CF02C8E84F297F7A0CA130C1D5722586749F" decryptionKey="48C8B6F952BC7C39DD91A2A17F17B08E113967DC5FF687FE6DFAF65F3248309C" validation="SHA1" decryption="AES"/>
    <authentication mode="Forms"/>
    <compilation debug="true" strict="false" explicit="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      </assemblies>
    </compilation>
  </system.web>
   <system.net>
  </system.net>
</configuration>

I am trying to use HDI custom membership provider and after seting up with web.config when I run the applcation it gives me an error as shown below.

And I am unable to know where I am going wrong?Can anyone point me the right way?

Failed to map the path '/'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidOperationException: Failed to map the path '/'.

This is my web.config:

<configuration>
  <connectionStrings>
    <add name="HDIConnectionString" providerName="System.Data.SqlClient" connectionString="Data Source=.\sqlexpress;Initial Catalog=HDIMembershipProvider;Integrated Security=True"/>
  </connectionStrings>
  <system.web>
    <membership defaultProvider="HDIMembershipProvider" userIsOnlineTimeWindow="15">
      <providers>
        <clear/>
        <add name="HDIMembershipProvider" type="HDI.AspNet.Membership.HDIMembershipProvider" connectionStringName="HDIConnectionString" enablePasswordRetrieval="true" enablePasswordReset="true" requiresQuestionAndAnswer="true" writeExceptionsToEventLog="false"/>
      </providers>
    </membership>
    <machineKey validationKey="34A0AF973A6817E4F7067DA1486E93AD5F7466B65D32405DB50766FDF335304F499C7B1943C084C7A67B1375D196CF02C8E84F297F7A0CA130C1D5722586749F" decryptionKey="48C8B6F952BC7C39DD91A2A17F17B08E113967DC5FF687FE6DFAF65F3248309C" validation="SHA1" decryption="AES"/>
    <authentication mode="Forms"/>
    <compilation debug="true" strict="false" explicit="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      </assemblies>
    </compilation>
  </system.web>
   <system.net>
  </system.net>
</configuration>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你丑哭了我 2024-12-13 01:49:08

我仅通过以管理员身份启动 Visual Studio 就解决了该问题。

I have rectified the problem just by starting Visual Studio as Administrator.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文