« Previous Next »

Thread: Problems with ASPNET 2.0 Applications with Validation Controls

Last post 09-10-2009 10:46 AM by GabeNodland. 23 replies.

Average Rating Rate It (5)

RSS

Page 1 of 2 (24 items) 1 2 Next >

Sort Posts:

  • 01-16-2008, 2:59 PM

    • ajk-eis
    • Not Ranked
    • Joined on 08-08-2003, 4:00 PM
    • Posts 8

    Problems with ASPNET 2.0 Applications with Validation Controls

    Hi,

    I don't know if this is the right place but since my hack / workaround involves the Classic .NET setting of the App Pool I think it is.

    I (and very many others) am having huge problems getting an ASPNET 2.0 application moved over to IIS 7 without using a Classic .NET App Pool.

    Because of the fact that validation controls are used in the web forms, the pages use WebResource.axd to get the client side scripting required.

    If I try to call any page with a validator (ASPNET 2.0 validator that is still current in VS 2008) in Integrated Mode then I get an error indicating that WebResource.axd must be registered in the web.config.

    Fine. I do exactly as I am told. No go - I get a 500 Error indicating that the configuration is invalid even though I did exactly as suggested in the previous error.
    I allow modification in the applicationServer.config.
    I run appCmd.exe to migrate the configuration (with out any error messages).
    I try every concievable change of the syntax (since after using appCmd.exe I now get errors indicating the name attribute is missing etc.).

    I am not alone. I am not able to successfully even run a small test page with a validator on it in Integrated Mode.

    This can not be right and I am still assuming that I am missing something, but no one has an answer.

    I would appreciate any help you could provide.

    Alle

  • 01-16-2008, 3:30 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 10:13 PM
    • Redmond, WA
    • Posts 2,247

    Re: Problems with ASPNET 2.0 Applications with Validation Controls

    If you post the exact error messages and the exact commands you ran to fix those and any relevant snippet of configuration etc, I am sure we will be able to help you.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 01-16-2008, 3:52 PM In reply to

    • ajk-eis
    • Not Ranked
    • Joined on 08-08-2003, 4:00 PM
    • Posts 8

    Re: Problems with ASPNET 2.0 Applications with Validation Controls

    Hello anilr,

    I am glad to hear your positive thinking we will be able to solve this. I have tried everything I have found. Unfortunately it is 10 PM here and I am at home however we can still start.

    If you look at the first post in the thread http://forums.asp.net/t/1155043.aspx you will see the first error. This error occurs in a simple ASP 2.0 Page in Integrated Mode if a validator is on it - This error listing is the ASP Error Page when the page is called
    "The WebResource.axd handler must be registered in the configuration
    to process this request.

    <!-- Web.Config Configuration File -->

    <configuration>
        <system.web>
            <httpHandlers>
                <add path="WebResource.axd" verb="GET"
    type="System.Web.Handlers.AssemblyResourceLoader" validate="True" />
            </httpHandlers>
        </system.web>
    </configuration>"

    I did EXACTLY what was listed - I added the httpHandler section to the web.config in the system.web section.

    I then recieve ASP Error pages that the name attribute is missing in the tag (which is true, it starts with path). Adding a fictiv name does not work, neither does name="WebResource.axd". 

     I then reverted to the text suggested in the first error and ran appCmd.exe migrate config "mySite/" from the command prompt. There were no errors or messages there. I had previously modified the applicationServer.config to allow configuration changes in the section. No other changes were made in the standard configuration.

    The httpHandlers portion of the IIS Mananger DOES show my entry (so I guess it migrated something ok) but without a name.

    When I now run I get the error I had at the beginning again, as if I hadn't changed anything.

    I'm sorry if the description isn't perfect, I'm working out of my memory (head!) since I'm at home. If this helps you and you have more specific questions I can get you the information tomorrow.

    Be glad for your patience and help.

    Alle

    BTW - this is on W2K8 Server RC0

     

  • 01-16-2008, 6:20 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 10:13 PM
    • Redmond, WA
    • Posts 2,247

    Re: Problems with ASPNET 2.0 Applications with Validation Controls

    system.web/httpHandlers is not used in integrated mode, you need to use system.webServer/handlers - the configuration would look like this

    <configuration>
        <system.webServer>
            <handlers>
                <add name="Foo" path="WebResource.axd" verb="GET"
    type="System.Web.Handlers.AssemblyResourceLoader" />
            </handlers>
        </system.webServer>
    </configuration>

    Please post exact details of the other error messages.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 01-17-2008, 1:05 AM In reply to

    • mmleinen
    • Not Ranked
    • Joined on 04-05-2004, 10:10 AM
    • Posts 5

    Re: Problems with ASPNET 2.0 Applications with Validation Controls

    Anil,

    I am having the same problem. I put the following into the section you suggested:

    <system.webServer>

    <handlers>

    <add name="WebResource" path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" />

    But here is the error I get again:

     

    The WebResource.axd handler must be registered in the configuration to process this request.

    <!-- Web.Config Configuration File -->

    <configuration>
       <system.web>
           <httpHandlers>
               <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="True" />
           </httpHandlers>
       </system.web>
    </configuration>

  • 01-17-2008, 3:30 AM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 10:13 PM
    • Redmond, WA
    • Posts 2,247

    Re: Problems with ASPNET 2.0 Applications with Validation Controls

    Can you use failed request tracing to collect a freb log for this request?  Instructions on how to use freb are there somewhere on iis.net

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 01-17-2008, 10:23 AM In reply to

    • ajk-eis
    • Not Ranked
    • Joined on 08-08-2003, 4:00 PM
    • Posts 8

    Re: Problems with ASPNET 2.0 Applications with Validation Controls

    Hi Anil,

    I had previously tried that, and several other ways without any success.

    If I limit my try to your suggestion I get exactly the same error afterwords although "foo" is listed a handler for WebResource.axd and in the sorted list is before any other *.axd listed as lokal (so the configuration did apply). I still can not call display the page with an ASP 2 validator on it.

    I'm afraid the error message is in german, but I'm sure you know what it's saying .

    I also ran a failed request trace but the output is much too large for a post.

    Contact me at alle(dash)bec(at) t(dash)online(dot)de and I will gladly mail it to you.

    I also tried removing the AssemblyResourceLoader-Integrated handler and reloading it without the precondition, doesn't work either.

    Zum Verarbeiten dieser Anforderung muss der Handler "WebResource.axd" in der Konfiguration registriert sein.

    <!-- Web.Config Configuration File -->

    <configuration>
       <system.web>
           <httpHandlers>
               <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="True" />
           </httpHandlers>
       </system.web>
    </configuration>

    Beschreibung: Unbehandelte Ausnahme beim Ausführen der aktuellen Webanforderung. Überprüfen Sie die Stapelüberwachung, um weitere Informationen über diesen Fehler anzuzeigen und festzustellen, wo der Fehler im Code verursacht wurde.

    Ausnahmedetails: System.InvalidOperationException: Zum Verarbeiten dieser Anforderung muss der Handler "WebResource.axd" in der Konfiguration registriert sein.

    <!-- Web.Config Configuration File -->

    <configuration>
       <system.web>
           <httpHandlers>
               <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="True" />
           </httpHandlers>
       </system.web>
    </configuration>

    Quellfehler:

    Beim Ausführen der aktuellen Webanforderung wurde einen unbehandelte Ausnahme generiert. Informationen über den Ursprung und die Position der Ausnahme können mit der Ausnahmestapelüberwachung angezeigt werden.


    Stapelüberwachung:
     
    [InvalidOperationException: Zum Verarbeiten dieser Anforderung muss der Handler "WebResource.axd" in der Konfiguration registriert sein.
     
    <!-- Web.Config Configuration File -->
     
    <configuration>
        <system.web>
            <httpHandlers>
                <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="True" />
            </httpHandlers>
        </system.web>
    </configuration>]
       System.Web.Handlers.AssemblyResourceLoader.GetWebResourceUrlInternal(Assembly assembly, String resourceName, Boolean htmlEncoded) +2556946
       System.Web.Handlers.AssemblyResourceLoader.GetWebResourceUrl(Type type, String resourceName, Boolean htmlEncoded) +530
       System.Web.UI.ClientScriptManager.GetWebResourceUrl(Page owner, Type type, String resourceName, Boolean htmlEncoded) +90
       System.Web.UI.ClientScriptManager.RegisterClientScriptResource(Control control, Type type, String resourceName) +89
       System.Web.UI.WebControls.BaseValidator.RegisterValidatorCommonScript() +205
       System.Web.UI.WebControls.BaseValidator.OnPreRender(EventArgs e) +70
       System.Web.UI.Control.PreRenderRecursiveInternal() +86
       System.Web.UI.Control.PreRenderRecursiveInternal() +170
       System.Web.UI.Control.PreRenderRecursiveInternal() +170
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2041
     

    Versionsinformationen: Microsoft .NET Framework-Version:2.0.50727.1416; ASP.NET-Version:2.0.50727.1416

     

  • 01-17-2008, 4:13 PM In reply to

    • tmarq
    • Top 150 Contributor
    • Joined on 06-11-2002, 2:44 PM
    • 42
    • Posts 42

    Re: Problems with ASPNET 2.0 Applications with Validation Controls

    I'm sorry you're having trouble with this. The exception occurs when the handler mapping is not found.  (Unfortunately the text of the error message is incorrect when running in integrated mode.  The error message says the handler needs to be mapped in the system.web/httpHandlers section, but for integrated mode it should say that it needs to be mapped in the system.webServer/handlers section.)

    Can you make a request to WebResource.axd (in that application) and paste the response here?  Could you also paste the WebResource.axd handler mapping from configuration?

  • 01-17-2008, 4:46 PM In reply to

    • ajk-eis
    • Not Ranked
    • Joined on 08-08-2003, 4:00 PM
    • Posts 8

    Re: Problems with ASPNET 2.0 Applications with Validation Controls

    Hi,

    I realize (realized) that. That is why Anil's suggestion made sense. But it still does not work. The error remains although the configuration is set as required. (system.webServer -> handlers section).

    Unfortunately we are over 10 hours apart (it's 10:30 PM here now) and I'm not at the office anymore. This means I can not call WebResource.axd until tomorrow. The Mapping is to System.Web.Handlers.AssemblyResourceLoader, but it always was, even in the default inherited configuration. If you require other information, other than that shown in the management interface or in the default mappings in applicationHost.conifg then please indicate where I should get them from. I have a document with screen shots of the configuration etc. but I would need an address to send them. Up to you.

    Actually I have the entire failed request trace, but that is too big to be posted and does not seem to hold anything interesting other than the error message above repeated several times for each validation control and the stack trace which ends at System.Web.Handlers.AssemblyResourceLoader.GetWebResourceUrlInternal(Assembly assembly, String resourceName, Boolean htmlEncoded)

     Maybe Randy can set off a call to http://hisSite/webResource.axd tonight and let you know what the results are - however I believe the call can not succeed without parameters that we do not have (for each control).

    Out of the applicationHost.config in the default section -
    <add path="AssemblyResourceLoader- Integrated" verb="GET,DEBUG" type="System.Web.Handlers.AssemblyResourceLoader" validate="True" />

    Alle

  • 01-18-2008, 1:26 PM In reply to

    • mmleinen
    • Not Ranked
    • Joined on 04-05-2004, 10:10 AM
    • Posts 5

    Re: Problems with ASPNET 2.0 Applications with Validation Controls

    I would hope that someone in the IIS7 team would take this one seriously. These are showstopper issues for IIS7. Is there anyone who has a web.config file that actually works with these validation controls in VS 2008 on IIS7? None of the suggestions have worked.

    Please someone respond.

  • 01-18-2008, 1:33 PM In reply to

    • ajk-eis
    • Not Ranked
    • Joined on 08-08-2003, 4:00 PM
    • Posts 8

    Re: Problems with ASPNET 2.0 Applications with Validation Controls

    Hello Randy,

    >>I would hope that someone in the IIS7 team would take this one seriously.<< 

    They are, believe me.

    We've been working this one offline since there is a 10 Hour time difference and there were alot of messages back and forth.

    My problem has just now (5 Minutes ago) been found with alot of help from Thomas from MS. It's an entry the Cold Fusion 8 makes in the default configuration of the applicationHost.config.

    If you see it, then you say my God why didn't I see that -

    <add name="AboMapperCustom-3325812" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\ColdFusion8\runtime\lib\wsconfig\1\jrun_iis6_wildcard.dll" requireAccess="None" responseBufferLimit="0" />

    Basically, Cold Fusion can't run without it and ASP can't run with it in integrated mode.

    They are still working on it to see if there is a way that both CF and ASP are happy.

    The section of the applicationHost.config concerned (for me) was-

    <location path="" overrideMode="Allow">
        <
    system.webServer>
               <
    handlers accessPolicy="Read, Script">

     That is the default configuration for all sites.

    HTH
    Alle

     

     

  • 01-18-2008, 2:36 PM In reply to

    • mmleinen
    • Not Ranked
    • Joined on 04-05-2004, 10:10 AM
    • Posts 5

    Re: Problems with ASPNET 2.0 Applications with Validation Controls

    Alle,

    Great info, thanks! Sorry if I sounded a little frustrated, but this has turned my world upside down - not be able to get my two most important web apps to run in a vista dev environment. I just bought a $6,000 dev machine from dell that only supports vista (go figure). So I have been feeling a little stressed about moving to vista. But you are right, I have coldfusion installed. I guess it is still a problem even if it is uninstalled, which I think I did.

    Thanks so much for being on top of this and including me in the loop.

    Sincerely,

    Randy

  • 01-18-2008, 5:20 PM In reply to

    • tmarq
    • Top 150 Contributor
    • Joined on 06-11-2002, 2:44 PM
    • 42
    • Posts 42

    Re: Problems with ASPNET 2.0 Applications with Validation Controls

    Sorry for the delay.  I understand the problem now.  Unfortunately, there is an incompatibility between ASP.NET integrated mode and ColdFusion8.

     

    So what exactly is the problem?  In some scenarios, ASP.NET emits HTML with <script src=”WebResource.axd?blah”>.   For example, the Validation Controls use this.  To ensure that the page will work, ASP.NET verifies that WebResource.axd is mapped to the AssemblyResourceLoader handler.  ASP.NET in integrated mode and ColdFusion8 are incompatible because ColdFusion8 has a wildcard mapping (*mapping) that overrides the WebResource.axd mapping in the system.webServer/handlers section, and so the check fails.   

    ASP.NET can alter this check to ignore the wildcard mapping and use the real handler mapping for WebResource.axd.  As long as the wildcard mapped handler eventually calls HSE_REQ_EXEC_URL and invokes the ASP.NET AssemblyResourceLoader handler, things will work as expected.  But this change to ASP.NET will probably have to be done in a hotfix after Windows Server 2008 releases.

     

    WORK AROUND:

     

    To work around this, you could run ASP.NET in classic mode.  On the other hand, if you need to use ASP.NET integrated mode, I recommend putting ASP.NET and ColdFusion8 in separate applications and setting up the handler mappings so that ColdFusion8 is not mapped in the ASP.NET application and ASP.NET is not mapped in the ColdFusion8 application.  You can do this in the UI, or by editing applicationHost.config by hand and encapsulating the system.webServer/handlers section in a <location path="blahblah"> </location> section.

     

  • 01-19-2008, 1:33 AM In reply to

    Re: Problems with ASPNET 2.0 Applications with Validation Controls

    Thank you for posting the solution.  This will be helpful for future people!

    Steve Schofield
    Windows Server MVP - IIS
    http://weblogs.asp.net/steveschofield


    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget
  • 01-19-2008, 5:12 AM In reply to

    • ajk-eis
    • Not Ranked
    • Joined on 08-08-2003, 4:00 PM
    • Posts 8

    Re: Problems with ASPNET 2.0 Applications with Validation Controls

    Hi Randy (and all other interested persons),

    sorry I didn't continue the thread yesterday, but I was shot after having spent the better part of three days (and nights) trying to figure this out. Add to that that tmarq (Thomas thanks again) and I are a oposite ends of the world (Thomas in Redmond with a cup of coffee fresh in the morning and I hungry at the end of a long Friday in Germany) I was glad to just shoot off the short success post and go home and to bed!

    Anyway I still have thoughts on this -

    1. UPDATE Jan. 20, 2008 - see my next post in this thread.

    2. Randy - I see no disadvantage with a VISTA developement box. I have one myself and have no quarrel with it. What you will have to do is go to your applicationHost.config and -

    • Make a back up copy
    • Delete the ColdFusion handler mapping that I listed above.
    • If you don't use CF anymore then delete all of the mappings that reference CF paths and you are done.
    • Subsite the CF App if you have one and make a "location" section for that subsite with a handlers section including the mapping that you deleted above. In fact you should be able to do that in the web.config using the syntax that Anil posted above.  If you have an integrated ASPNET App as I do you will have to change the AppPool to compatible mode.
    • If you can subsite the ASPNET App, run it in a separate App Pool (better anyway)
    • For the ASPNET Subsite you can run integrated mode.

    3. Optionally, if you can subsite the ASPNET App you should be able to use "remove" tags in the web.config for that subsite to delete all of the Cold Fusion Mappings in the applicationHost.config for that subsite. That's the nice thing about IIS 7 configuration.

    Many, many thanks to Thomas and the other folks at MS for the prompt and "exclusive" handling of this problem.

    HTH
    Alle

Page 1 of 2 (24 items) 1 2 Next >