webconfig conflict: "UploadHttpModule"

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

webconfig conflict: "UploadHttpModule"

Jeff Stewart
I have an application which makes use of NeatUpload. I have this application running on my dev box (running WinXP/IIS5.1) and on a staging server running Win2k3. All works fine on these.
Today, a co-worker opened the solution in Visual Studio and while the app compiles, when he tries to run a page which has the NeatUpload controls on it, he gets the following error:

HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.

Module IIS Web Core
Notification BeginRequest
Handler Not yet determined
Error Code 0x800700b7
Config Error Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'UploadHttpModule'


His machine is running Vista/IIS7. This error appears to be related to the 2 entries added to web.config per the install instructions:

Add the line below to the configuration/system.web/httpModules section of your Web.config. If you are using other 3rd-party modules, see the Module conflict section for details.
<add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload" />

Add the line below to the configuration/system.webServer/modules section of your Web.config to support IIS7's Integrated Pipeline Mode (which is used in it's default application pool). If you are using other 3rd-party modules, see the Module conflict section for details.
<add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload" preCondition="managedHandler"/>

Any ideas on why it fails, only in this environment? Any assistance GREATLY appreciated!
Reply | Threaded
Open this post in threaded view
|

Re: webconfig conflict: "UploadHttpModule"

Dean Brettle
Administrator
Does his machine.config have a module named UploadHttpModule in it for some reason?
Reply | Threaded
Open this post in threaded view
|

Re: webconfig conflict: "UploadHttpModule"

Jeff Stewart
No... we searched it for "UploadHttpModule " in his machine.config and nothing found.  (BTW... THANKS for the amazingly quick reply!)

=jeff
Reply | Threaded
Open this post in threaded view
|

Re: webconfig conflict: "UploadHttpModule"

Guest-999
Is there any other info I might be able to supply that might help figure this one out?
Reply | Threaded
Open this post in threaded view
|

Re: webconfig conflict: "UploadHttpModule"

Dean Brettle
Administrator
Please post or email me (dean at brettle dot com) your Web.config with sensitive info redacted.

BTW, can he open NeatUpload-version/dotnet/app as a website in VS and visit a the app/Brettle.Web.NeatUpload/Demo.aspx page?

--Dean
Reply | Threaded
Open this post in threaded view
|

Re: webconfig conflict: "UploadHttpModule"

Jeff Stewart
Yes, he can run the demo application just fine. Here is the web.config:

<?xml version="1.0"?>
<!--
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine.config.comments usually located in
    \Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
    <configSections>
        <!-- NeatUpload control specific change -->
        <section name="neatUpload" type="Brettle.Web.NeatUpload.ConfigSectionHandler, Brettle.Web.NeatUpload" allowLocation="true"/>
        <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
            <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                    <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
                    <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                    <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                    <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/></sectionGroup>
            </sectionGroup>
        </sectionGroup>
    </configSections>
    <appSettings file="User.config">

        <add key="ODBCConnection" value="DRIVER={SQL Server};server=localhost;uid=sa;pwd=XXXXXXXX;database=XXXXXXXX"/>
        <add key="SQLConnection" value="Data Source=localhost;Initial Catalog=XXXXXXXX;User ID=sa;Password='XXXXXXXX';"/>
        <add key="VideoFileMimeTypes" value="video/x-msvideo,video/x-dv,video/quicktime,video/mpeg,video/mp4,video/x-ms-asf,video/x-ms-wmv,video/x-flv,application/octet-stream"/>
        <add key="SSTversion" value="1.4.25"/>
    <add key="VTS.VideoTranscodeService" value="http://XXX.XXX.com/vts/XXXXXXXXXXXXXX.asmx"/>
    </appSettings>
    <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
        <modules>
            <!-- NeatUpload control specific change -->
            <add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload" preCondition="managedHandler"/>
            <remove name="ScriptModule"/>
            <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        </modules>
        <handlers>
            <remove name="WebServiceHandlerFactory-Integrated"/><remove name="WebServiceHandlerFactory-ISAPI-2.0"/>
            <remove name="ScriptHandlerFactory"/>
            <remove name="ScriptHandlerFactoryAppServices"/>
            <remove name="ScriptResource"/>
            <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        </handlers>
        <security>
            <requestFiltering>
                <!-- NeatUpload control specific change -->
                <requestLimits maxAllowedContentLength="2147483648"></requestLimits>
            </requestFiltering>
        </security>
    </system.webServer>
    <system.web>
        <!-- NeatUpload control specific change -->
        <httpRuntime maxRequestLength="2097151" executionTimeout="3600"/>
        <compilation debug="true" strict="false" explicit="true">
            <assemblies>
                <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
            </assemblies>
        </compilation>
        <httpHandlers>
            <remove verb="*" path="*.asmx"/>
            <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
        </httpHandlers>
        <pages enableViewStateMac="false" enableEventValidation="false" viewStateEncryptionMode="Never">
            <!-- <pages  validateRequest="true"> -->
            <controls>
                <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            </controls>
            <namespaces>
                <clear/>
                <add namespace="System"/>
                <add namespace="System.Collections"/>
                <add namespace="System.Collections.Specialized"/>
                <add namespace="System.Configuration"/>
                <add namespace="System.Text"/>
                <add namespace="System.Text.RegularExpressions"/>
                <add namespace="System.Web"/>
                <add namespace="System.Web.Caching"/>
                <add namespace="System.Web.SessionState"/>
                <add namespace="System.Web.Security"/>
                <add namespace="System.Web.Profile"/>
                <add namespace="System.Web.UI"/>
                <add namespace="System.Web.UI.WebControls"/>
                <add namespace="System.Web.UI.WebControls.WebParts"/>
                <add namespace="System.Web.UI.HtmlControls"/>
            </namespaces>
        </pages>
        <!--
            The <customErrors> section enables configuration
            of what to do if/when an unhandled error occurs
            during the execution of a request. Specifically,
            it enables developers to configure html error pages
            to be displayed in place of a error stack trace.
        -->
        <customErrors mode="Off" defaultRedirect="ErrorPage.html">
            <error statusCode="403" redirect="ErrorPage.html"/>
            <error statusCode="404" redirect="ErrorPage.html"/>
        </customErrors>
        <authentication mode="Forms">
            <forms loginUrl="Login.aspx" defaultUrl="Index.aspx" protection="All" timeout="15000" path="/"/>
        </authentication>
        <authorization>
            <deny users="?"/>
        </authorization>
        <httpModules>
            <!-- NeatUpload control specific change -->
            <add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload"/>
            <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></httpModules></system.web>
    <location path="css">
        <system.web>
            <authorization>
                <allow users="*"/>
            </authorization>
        </system.web>
    </location>
    <location path="PasswordLookup.aspx">
        <system.web>
            <authorization>
                <allow users="*"/>
            </authorization>
        </system.web>
    </location>
    <location path="img">
        <system.web>
            <authorization>
                <allow users="*"/>
            </authorization>
        </system.web>
    </location>
    <location path="test">
        <system.web>
            <authorization>
                <allow users="*"/>
            </authorization>
        </system.web>
    </location>
    <location path="xml">
        <system.web>
            <authorization>
                <allow users="*"/>
            </authorization>
        </system.web>
    </location>
    <system.codedom>
        <compilers>
            <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
                <providerOption name="CompilerVersion" value="v3.5"/>
                <providerOption name="WarnAsError" value="false"/></compiler>
            <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
                <providerOption name="CompilerVersion" value="v3.5"/>
                <providerOption name="OptionInfer" value="true"/>
                <providerOption name="WarnAsError" value="false"/></compiler></compilers></system.codedom>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
                <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/></dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
                <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/></dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>

Reply | Threaded
Open this post in threaded view
|

Re: webconfig conflict: "UploadHttpModule"

Dean Brettle
Administrator
Any mention of an UploadHttpModule in \windows\system32\inetsrv\config\applicationHost.config?

Does changing the name attribute to NeatUploadHttpModule, fix it?

How about removing the <add> line in one or the other sections, so see which one is causing the problem?

--Dean