locked
Problems with ASPNET 2.0 Applications with Validation Controls RRS feed

  • Question

  • User-376811694 posted

    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

    Wednesday, January 16, 2008 2:59 PM

Answers

  • User-376811694 posted

    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

     

     

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Friday, January 18, 2008 1:33 PM
  • User229670690 posted

    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.  <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p><o:p> </o:p>

    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.

     

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Friday, January 18, 2008 5:20 PM

All replies

  • User511787461 posted

    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.

    Wednesday, January 16, 2008 3:30 PM
  • User-376811694 posted

    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

     

    Wednesday, January 16, 2008 3:52 PM
  • User511787461 posted

    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.

    Wednesday, January 16, 2008 6:20 PM
  • User992038597 posted

    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>

    Thursday, January 17, 2008 1:05 AM
  • User511787461 posted

    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

    Thursday, January 17, 2008 3:30 AM
  • User-376811694 posted

    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>
    <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>

    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: <o:p></o:p>

    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. <o:p></o:p>


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

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

     

    Thursday, January 17, 2008 10:23 AM
  • User229670690 posted

    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?

    Thursday, January 17, 2008 4:13 PM
  • User-376811694 posted

    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

    Thursday, January 17, 2008 4:46 PM
  • User992038597 posted

    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.

    Friday, January 18, 2008 1:26 PM
  • User-376811694 posted

    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

     

     

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Friday, January 18, 2008 1:33 PM
  • User992038597 posted

    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

    Friday, January 18, 2008 2:36 PM
  • User229670690 posted

    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.  <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p><o:p> </o:p>

    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.

     

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Friday, January 18, 2008 5:20 PM
  • User1073881637 posted

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

    Saturday, January 19, 2008 1:33 AM
  • User-376811694 posted

    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

    Saturday, January 19, 2008 5:12 AM
  • User-376811694 posted

    UPDATE -

    MS has contacted me, and indicates that they feel this is in fact an error in ASPNET  (and not Cold Fusion). Wildcard mappings are allowed and CF correctly redirects as it should. My apologies to Adobe.

    MS will be working on a hotfix for this problem. When it is available I will let you know here.

    Cheers
    Alle

    Sunday, January 20, 2008 11:30 AM
  • User-192600027 posted

    Was there ever a fix created for this?  We're running into the same issue with CFMX8 and IIS7 and its been 1.5 years since the last post in this thread.

    Monday, August 31, 2009 1:53 PM
  • User229670690 posted

    It is fixed in v2.0 SP2, which is included with v3.5 SP1.  The fix was to make ASP.NET ignore the wildcard mapping installed by ColdFusion8.

    Tuesday, September 1, 2009 1:50 PM
  • User-192600027 posted

    Well we're still getting this issue with a fully patched Win 2008 Server running IIS, CFMX 8.0.1 fully patched, with .NET 2.0 and 3.5 both fully patched.  I had to go in and remove the CF wildcard mapping from the ASP.NET application that runs as a virtual folder of the CF website.  Until I did that we continually got the error message others have reported that lead me to here.

    Tuesday, September 1, 2009 2:22 PM
  • User229670690 posted

    The page at http://support.microsoft.com/contactus/?ws=support explains how to contact product support.  You can contact them and request a QFE.  As mentioned earlier, it is fixed in v2.0 SP2 and v3.5 SP1.

    Thanks,
    Thomas

    Tuesday, September 1, 2009 9:19 PM
  • User-192600027 posted

    Thank you very much for the information, I will do just that.

    Wednesday, September 2, 2009 8:58 AM
  • User928748695 posted
    Hello, I also have all the latest service packs for .net and i still have this exact issue. Brentil did you find anything further on this? Do I need to request the QFE. I guess for now i will just have to go into every .net app and remove jrun_iis6_wildcard.dll handler. Thanks, Gabe
    Thursday, September 10, 2009 10:32 AM
  • User-192600027 posted
    I haven't done any support for it yet since I haven't had time to.  I fixed it in our case by removing the CF wildcard and all other CF references from the virtual directory we were running .NET code from.  The main site is CF but just a sub app was .NET so it allowed us to do this.
    Thursday, September 10, 2009 10:37 AM
  • User928748695 posted
    Brentil, thanks for the quick reply. I guess that is what I will do for now too. I will let you know if I find anything. Thanks, Gabe
    Thursday, September 10, 2009 10:46 AM
  • User1909394831 posted
    I haven't done any support for it yet since I haven't had time to.  I fixed it in our case by removing the CF wildcard and all other CF references from the virtual directory we were running .NET code from.  The main site is CF but just a sub app was .NET so it allowed us to do this.
    Hi, friends!

    I'm sorry but I don't even know how to change the "applicationhost.config". I don't have this file in my list of root files and my hosting just give me a control panel so I am very limited. Im having the same initial problem about webresource.axd:

    ... add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="True" ...

    How do I know if there is coldfusion installed there?
    The situation now is when I change the app to classic, the web site works "fine" except for AJAX controllers. When I switch back to integrated, I have the mentioned error. Thanks for your attention. Humberto
    Tuesday, December 28, 2010 7:05 AM