应用程序名称=“/”即使明确指定?

发布于 2024-10-11 08:52:13 字数 1868 浏览 2 评论 0原文

当我的页面 config.aspx 加载时,会创建一个与当前用户关联的配置文件条目 - 这工作正常。 但是,即使我显式指定 applicationname="MyTool",applicationname 字段在 aspnet_applications 表中设置为“/”

所以我猜测还有另一个地方应该设置 applicationname - 到目前为止我有:

<add name="SqlProvider" 
     type="System.Web.Security.SqlMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
     connectionStringName="MyToolConnection" 
     enablePasswordRetrieval="false" 
     enablePasswordReset="true" 
     requiresQuestionAndAnswer="false" 
     applicationName="/MyTool"              <-- I tried both "MyTool" and "/MyTool"
     requiresUniqueEmail="true" 
     minRequiredPasswordLength="7" 
     minRequiredNonalphanumericCharacters="0" 
     passwordFormat="Hashed" 
     maxInvalidPasswordAttempts="5" 
     passwordAttemptWindow="10" 
     passwordStrengthRegularExpression="" />


 <roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider" >
      <providers>
        <clear />
        <add connectionStringName="MyToolConnection" applicationName="/MyTool" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" />
        <add applicationName="/MyTool" name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" />
      </providers>
    </roleManager>




 <connectionStrings>
    <remove name="LocalSqlServer" />
    <add name="LocalSqlServer" connectionString="Application Name=/MyTool;Data Source=.\SQLEXPRESS;Initial Catalog=MyTool;Integrated Security=True" providerName="System.Data.SqlClient" />
    <add name="MyToolConnection" connectionString="Application Name=/MyTool;Data Source=.\SQLEXPRESS;Initial Catalog=MyTool;Integrated Security=True" providerName="System.Data.SqlClient" /> 
  </connectionStrings>

when my page config.aspx loads, a profile entry is created in association with the current user - This is working fine.
However, even though I specify explicitly the applicationname="MyTool", the applicationname field is set to '/' in the aspnet_applications table

So I'm guessing that there is another place where I should set the applicationname - so far I have:

<add name="SqlProvider" 
     type="System.Web.Security.SqlMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
     connectionStringName="MyToolConnection" 
     enablePasswordRetrieval="false" 
     enablePasswordReset="true" 
     requiresQuestionAndAnswer="false" 
     applicationName="/MyTool"              <-- I tried both "MyTool" and "/MyTool"
     requiresUniqueEmail="true" 
     minRequiredPasswordLength="7" 
     minRequiredNonalphanumericCharacters="0" 
     passwordFormat="Hashed" 
     maxInvalidPasswordAttempts="5" 
     passwordAttemptWindow="10" 
     passwordStrengthRegularExpression="" />


 <roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider" >
      <providers>
        <clear />
        <add connectionStringName="MyToolConnection" applicationName="/MyTool" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" />
        <add applicationName="/MyTool" name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" />
      </providers>
    </roleManager>




 <connectionStrings>
    <remove name="LocalSqlServer" />
    <add name="LocalSqlServer" connectionString="Application Name=/MyTool;Data Source=.\SQLEXPRESS;Initial Catalog=MyTool;Integrated Security=True" providerName="System.Data.SqlClient" />
    <add name="MyToolConnection" connectionString="Application Name=/MyTool;Data Source=.\SQLEXPRESS;Initial Catalog=MyTool;Integrated Security=True" providerName="System.Data.SqlClient" /> 
  </connectionStrings>

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

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

发布评论

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

评论(1

孤寂小茶 2024-10-18 08:52:13

您在问题中提到了“个人资料”。

您是否还在 web.config 的 元素中设置应用程序名称?

<profile enabled="true" defaultProvider="SqlServices">
<providers>
<clear/>
<add name="SqlProvider" type="System.Web.Profile.SqlProfileProvider"
connectionStringName="SqlServices" applicationName="MyTool" />
</providers>

You mentioned "profiles" in your question.

Are you also setting the application name in the <profile> element of the web.config?

<profile enabled="true" defaultProvider="SqlServices">
<providers>
<clear/>
<add name="SqlProvider" type="System.Web.Profile.SqlProfileProvider"
connectionStringName="SqlServices" applicationName="MyTool" />
</providers>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文