使用 Web 应用程序时出现 Web.Config 错误
我使用这个 Web.Config 文件。 如果我使用网站管理工具作为“网站”,一切都运行良好。
如果我使用与“Web 应用程序”相同的脚本,我会在“安全”选项卡中收到错误。 错误:
“您选择的数据存储存在问题。这可能是由于服务器名称或凭据无效,或者权限不足引起的。也可能是由于未启用角色管理器功能引起的。单击下面的按钮即可重定向到可以选择新数据存储的页面
以下消息可能有助于诊断问题: 无法开始监视对 'Z:\MSDOS_DOCUMENTS_SETTINGS\SWN-Working\Projects-Cms\Cms-Application-ProtoTypes\Admin 的更改。 -RolesPermissions\ProtoType-Rules\ProtoType-Rules'”
我真的不知道我做错了什么。你能给我建议吗?感谢您的支持!
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<connectionStrings>
<add name="CmsConnectionString"
connectionString="Data Source=.;Initial Catalog=DbCmsWebsiteTest;Integrated Security=SSPI" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<roleManager enabled="true" cacheRolesInCookie="true">
<providers>
<clear/>
<add name="AspNetSqlRoleProvider"
connectionStringName="CmsConnectionString"
applicationName="/"
type="System.Web.Security.SqlRoleProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</roleManager>
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider"
connectionStringName="CmsConnectionString"
applicationName="/"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
requiresUniqueEmail="false"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="1"
passwordAttemptWindow="10"
passwordStrengthRegularExpression=""/>
</providers>
</membership>
</system.web>
</configuration>
I use this Web.Config file.
If I use Web Site Administration Tools as "Web Site" all is working great.
If I use the same script as "Web Application" I receive and error in tab "Security".
Error:
"There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store.
The following message may help in diagnosing the problem: Failed to start monitoring changes to 'Z:\MSDOS_DOCUMENTS_SETTINGS\SWN-Working\Projects-Cms\Cms-Application-ProtoTypes\Admin-RolesPermissions\ProtoType-Rules\ProtoType-Rules'. "
I really do not know what I am doing wrong. Could you please advice me? Thanks for your support!
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<connectionStrings>
<add name="CmsConnectionString"
connectionString="Data Source=.;Initial Catalog=DbCmsWebsiteTest;Integrated Security=SSPI" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<roleManager enabled="true" cacheRolesInCookie="true">
<providers>
<clear/>
<add name="AspNetSqlRoleProvider"
connectionStringName="CmsConnectionString"
applicationName="/"
type="System.Web.Security.SqlRoleProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</roleManager>
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider"
connectionStringName="CmsConnectionString"
applicationName="/"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
requiresUniqueEmail="false"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="1"
passwordAttemptWindow="10"
passwordStrengthRegularExpression=""/>
</providers>
</membership>
</system.web>
</configuration>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了解决我的问题的方法。
解决方案在这里
http://support.microsoft.com/kb/317955
I found out solution to my problems.
Solution it is here
http://support.microsoft.com/kb/317955