ASP.NET:此方法不能在应用程序的pre启动初始化阶段称为 [英] ASP.NET: This method cannot be called during the application's pre-start initialization stage

查看:86
本文介绍了ASP.NET:此方法不能在应用程序的pre启动初始化阶段称为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图得到一个ASP.NET MVC 3网站IIS 6.0上运行。

I'm trying to get an ASP.NET MVC 3 site running on IIS 6.0.

目前,当我请求一个页面从服务器时,它提供了以下错误:

Currently when I request a page from the server it gives the following error:

Parser Error Message: This method cannot be called during the application's pre-start initialization stage.

在这条线:

<add name="MyMembershipProvider" type="NS.MyMembershipProvider" connectionStringName="MyDatabase" applicationName="/MySite"/>

我完全难倒并没有太多关于ASP.NET应用程序生命周期的线索,更不用说6.0和7.0之间的差异。通过它的MSDN网页阅读似乎并没有多大帮助。

I'm completely stumped and don't have much of a clue about the ASP.NET application lifecycle, let alone the differences between 6.0 and 7.0. Reading through the MSDN pages on it hasn't seemed to help much.

有没有人有任何见解或调查的任何良好的联系? :)

Does anyone have any insight or any good links for investigation? :)

感谢

推荐答案

在你的web.config添加这个(在appSettings部分):

Add this in your web.config (in the appSettings section):

<add key="enableSimpleMembership" value="false"/>
<add key="autoFormsAuthentication" value="false"/>

编辑:

有关谁问,为什么的人,它是在MVC 3 发行说明
更多细节here

For the ones who ask why, it is a known issue described in the mvc 3 release notes More details here

这篇关于ASP.NET:此方法不能在应用程序的pre启动初始化阶段称为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆