应用程序名称=“/”即使明确指定?
当我的页面 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您在问题中提到了“个人资料”。
您是否还在 web.config 的
元素中设置应用程序名称?You mentioned "profiles" in your question.
Are you also setting the application name in the
<profile>
element of the web.config?