ASP.NET 网站管理工具未知错误 ASP.NET 4 VS 2010

发布于 2024-09-03 07:01:14 字数 2953 浏览 2 评论 0原文

我正在使用具有完整 sql server 2008 r2 的计算机来遵循 MVCMusic 教程 和完整的 Visual Studio 专业版,在 ASP.NET 4.0 中,当我到达设置成员资格的页面(靠近第 66 页)时,Web 管理工具无法工作,我出现以下错误:

遇到错误。请返回上一页并重试。

我的网络配置是这样的:

<connectionStrings>
        <clear />
        <add name="MvcMusicStoreCN" connectionString="Data Source=.;Initial Catalog=MvcMusicStore;Integrated Security=True" providerName="System.Data.SqlClient" />
        <add name="MvcMusicStoreEntities" connectionString="metadata=res://*/Models.Store.csdl|res://*/Models.Store.ssdl|res://*/Models.Store.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.;Initial Catalog=MvcMusicStore;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
    </connectionStrings>

<system.web>
<membership defaultProvider="AspNetSqlMembershipProvider">
            <providers>
                <clear />
                <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" 
                     connectionStringName="MvcMusicStoreCN" enablePasswordRetrieval="false" 
                     enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="false" 
                     maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" 
                     passwordAttemptWindow="10" applicationName="/" passwordFormat="Hashed"  />
            </providers>
        </membership>
        <profile>
            <providers>
                <clear />
                <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" 
                     connectionStringName="MvcMusicStoreCN" applicationName="/" />
            </providers>
        </profile>
        <roleManager enabled="true" defaultProvider="AspNetSqlRoleProvider">
            <providers>
                <clear />
                <add connectionStringName="MvcMusicStoreCN" applicationName="/"
                  name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" />
                <add applicationName="/" name="AspNetWindowsTokenRoleProvider"
                  type="System.Web.Security.WindowsTokenRoleProvider" />
            </providers>
        </roleManager>
        <customErrors mode="Off">
        </customErrors>
</system.web>

编辑:我已经运行

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regsql.exe

可执行文件并将表成功添加到我的 MvcMusicStore 数据库中,从 MY 应用程序 (MVCMusicStore) 更改了 web.config ,并尝试运行 ASP.NET 配置快捷方式,但出现错误。 我的默认浏览器是 Firefox,当我单击快捷方式时,浏览器甚至不会打开页面,只有当我右键单击托盘图标并选择在网络浏览器中打开时。

I was following the MVCMusic tutorial with an machine with full sql server 2008 r2
and full visual studio professional, in ASP.NET 4.0 and when I got to the page where it sets up membership (near page 66) the Web administration tool wont work, i got the following error:

An error was encountered. Please return to the previous page and try again.

my web config is like this:

<connectionStrings>
        <clear />
        <add name="MvcMusicStoreCN" connectionString="Data Source=.;Initial Catalog=MvcMusicStore;Integrated Security=True" providerName="System.Data.SqlClient" />
        <add name="MvcMusicStoreEntities" connectionString="metadata=res://*/Models.Store.csdl|res://*/Models.Store.ssdl|res://*/Models.Store.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.;Initial Catalog=MvcMusicStore;Integrated Security=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
    </connectionStrings>

<system.web>
<membership defaultProvider="AspNetSqlMembershipProvider">
            <providers>
                <clear />
                <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" 
                     connectionStringName="MvcMusicStoreCN" enablePasswordRetrieval="false" 
                     enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="false" 
                     maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" 
                     passwordAttemptWindow="10" applicationName="/" passwordFormat="Hashed"  />
            </providers>
        </membership>
        <profile>
            <providers>
                <clear />
                <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" 
                     connectionStringName="MvcMusicStoreCN" applicationName="/" />
            </providers>
        </profile>
        <roleManager enabled="true" defaultProvider="AspNetSqlRoleProvider">
            <providers>
                <clear />
                <add connectionStringName="MvcMusicStoreCN" applicationName="/"
                  name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" />
                <add applicationName="/" name="AspNetWindowsTokenRoleProvider"
                  type="System.Web.Security.WindowsTokenRoleProvider" />
            </providers>
        </roleManager>
        <customErrors mode="Off">
        </customErrors>
</system.web>

EDIT: I've run the

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regsql.exe

executable and added the tables to my MvcMusicStore database sucessfully, changed the web.config from MY application (MVCMusicStore), and tryed running the ASP.NET Configuration shortcut, and got the error.
My Default Browser is firefox, and when I click the shortcut the browser doesn't even open the page, only when I right click on the tray icon and choose open in web browser.

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

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

发布评论

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

评论(3

回心转意 2024-09-10 07:01:14

我已经解决了,我进入另一个项目(VS 2010不允许我更改MVC项目中的默认浏览器)更改了默认浏览器,改回MVC项目并尝试再次打开配置,它起作用了。
看起来配置不允许 firefox。
不管怎样,谢谢拉吉。

I've solved it, I entered another project (VS 2010 doesn't let me change the default browser in an MVC project) changed the default browser, changed back to the MVC project and tryed opening the configuration again, and it worked.
Looks like the configuration doesn't allow firefox.
Thanks Anyway Raj.

离旧人 2024-09-10 07:01:14

通过关闭自定义错误让您的应用显示详细错误
http://msdn.microsoft.com/en-us /library/h0hfz6fc(VS.71).aspx

<configuration>
   <system.web>
      <customErrors mode="Off">
      </customErrors>
   </system.web>
</configuration>

Get your app to show detailed errors by turning off custom errors
http://msdn.microsoft.com/en-us/library/h0hfz6fc(VS.71).aspx

<configuration>
   <system.web>
      <customErrors mode="Off">
      </customErrors>
   </system.web>
</configuration>
倒带 2024-09-10 07:01:14

我也遇到了这个问题,发现这是因为我的解决方案所在的目录包含一个奇怪的字符。 'C:....\C#' 将目录更改为 CSharp 解决了这个问题。

I also experienced this problem and found out it was because the directory my solution was in contained a weird character. 'C:....\C#' Changing the directory to CSharp got rid of this problem.

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