【发布时间】:2012-07-16 18:26:51
【问题描述】:
场景
我正在尝试在我的 ASP.Net 应用程序中自动启动/保持活动/预加载信息。说明简单明了:ASP.Net + IIS 7.5 - Preloading & Auto Starting,但我在 IIS 7.5 Express 中这样做时遇到问题。我收到有关某些配置元素的 500.19 错误。以下是上下文和问题:
ApplicationHost.config
<!-- Inside the ApplicationPools element we tell the appropriate app pool
to auto start and always run. -->
<add name="Clr4IntegratedAppPool" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated" CLRConfigFile="%IIS_USER_HOME%\config\aspnet.config" autoStart="true" startMode="AlwaysRunning" />
<!-- In the Sites element we first ensure our application is using the correct
app pool. Then we tell it to use the pools auto start functionality, and
point it towards a provider to use. -->
<site name="ED.Web" id="11">
<application path="/" applicationPool="Clr4IntegratedAppPool" serviceAutoStartEnabled="true" serviceAutoStartProvider="Preload-UserReconciliation">
<!-- everything is properly closed -->
<!-- Just before closing the Sites element we declare a provider; it identifies
the class within a particular assembly that should be used for preloading -->
<serviceautostartproviders>
<add name="Preload-UserReconciliation" type="ED.Web.ApplicationPreload, ED.Web" />
</serviceautostartproviders>
</sites>
错误 1
错误 500.19,无法识别元素“serviceautostartproviders”
239: <serviceautostartproviders>
240: <add name="Preload-UserReconciliation" type="ED.Web.ApplicationPreload, ED.Web" />
错误 2 [编辑]
完全关闭 IIS Express 并再次从 VS 启动应用程序后,我得到一个 Visual Studio 弹出窗口:"Unable to launch the IIS Express Web server."
问题
如何正确设置 IIS Express 7.5 以启动池,并使用我的 ApplicationPreload : IProcessHostPreloadClient 类预加载应用程序?
【问题讨论】:
-
在您的 sn-p.. 中看不到开头的
标记?远射,可能,但有时是简单的事情...... :) 实际上,整个 块不属于 before 部分吗?看起来它们可能嵌套在您的示例中.. -
感谢您的回复。 cmets 解释了这些特定元素的放置位置。 XML 结构是 100% 好的(至少它符合 ASP.Net 上的说明):)
-
足够好了..只是从那里看两个分开的样本,并在您的 sn-p 中看到嵌套的样本...
-
检查答案。我活该被程序员修女骂。
-
LOL 很容易被忽视。我自己也没注意到:)
标签: asp.net .net-4.0 iis-7.5 asp.net-4.0 iis-express