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

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

问题描述

我正在尝试让一个在 IIS 6.0 上运行的 ASP.NET MVC 3 站点.

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 release 中描述的已知问题笔记更多详情这里

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

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

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