gpt4 book ai didi

c# - 使用 Microsoft Visual Web Developer 2010 Express 的 Web.Config 中无法识别的配置部分 httpHandlers

转载 作者:行者123 更新时间:2023-11-30 14:42:41 25 4
gpt4 key购买 nike

我需要一些帮助来解决我在使用 Microsoft Visual Web Developer 2010 Express 时收到的错误消息。

我想为我的网站创建一个画廊,所以我从 codeplex 下载了 NotesForGallery。我已将引用添加到项目中,就像它在安装说明中告诉我的那样。说明然后说

在 Web.Config 文件(httpHandlers 部分)中注册 ThumbnailHandler:

<httpHandlers>

<add verb="*" path="ThumbnailHandler.ashx" type="NotesFor.ThumbnailHandler, NotesForGallery"/>

</httpHandlers>

所以我在我的解决方案中打开 web.config 文件并将其添加进去。当我尝试启动网站时(单击 Web Developer 中的播放按钮)我收到错误消息:

无法识别的配置部分 httpHandlers。

我得到的完整错误列表是:

消息 1 找不到元素“httpHandlers”的架构信息。 C:\Documents and Settings\adam\My Documents\Visual Studio 2010\WebSites\FatBoyFudge\Web.config 38 4 C:...\FatBoyFudge\消息 2 找不到元素“添加”的架构信息。 C:\Documents and Settings\adam\My Documents\Visual Studio 2010\WebSites\FatBoyFudge\Web.config 39 8 C:...\FatBoyFudge\消息 3 找不到属性“verb”的架构信息。 C:\Documents and Settings\adam\My Documents\Visual Studio 2010\WebSites\FatBoyFudge\Web.config 39 12 C:...\FatBoyFudge\消息 4 找不到属性“路径”的架构信息。 C:\Documents and Settings\adam\My Documents\Visual Studio 2010\WebSites\FatBoyFudge\Web.config 39 21 C:...\FatBoyFudge\消息 5 找不到属性“类型”的架构信息。 C:\Documents and Settings\adam\My Documents\Visual Studio 2010\WebSites\FatBoyFudge\Web.config 39 50 C:...\FatBoyFudge\错误 6 无法识别的配置部分 httpHandlers。 C:\Documents and Settings\adam\My Documents\Visual Studio 2010\WebSites\FatBoyFudge\Web.config 38
警告 7 C:\Documents and Settings\adam\My Documents\Visual Studio 2010\WebSites\FatBoyFudge\Gallery.aspx:ASP.NET 运行时错误:无法识别的配置节 httpHandlers。 (C:\Documents and Settings\adam\My Documents\Visual Studio 2010\WebSites\FatBoyFudge\web.config 第 38 行) C:\Documents and Settings\adam\My Documents\Visual Studio 2010\WebSites\FatBoyFudge\Gallery.aspx 1 1 C:...\FatBoyFudge\

我创建的项目是一个网站,如果有帮助的话。

完整的web.config如下:

<configuration>
<connectionStrings>
<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880"/>
</authentication>
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/>
</providers>
</membership>
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear/>
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/"/>
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/"/>
</providers>
</roleManager>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
<httpHandlers>
<add verb="*" path="ThumbnailHandler.ashx" type="NotesFor.ThumbnailHandler, NotesForGallery"/>
</httpHandlers>
</configuration>

你能给我的任何帮助都会很方便,因为我不确定我做错了什么

最佳答案

将您的 httpHandlers 放入 system.web 部分。

关于c# - 使用 Microsoft Visual Web Developer 2010 Express 的 Web.Config 中无法识别的配置部分 httpHandlers,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2935592/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com