Search code examples
asp.netazurehttphandlerazure-web-roles

HTTP Handler doesn't hitted, while it run over cloud, when request needs to be redirected to another Server from IIS?


My Asp.net application is hosted over Azure Cloud,

In that application I do have a Java Chat control, which has its server on Linux,

now I have created a HTTPHandler to redirect that chat request to the Linux server, but some how it doesn't work over the Cloud environment (though it works very well on web environment)

it shows the below error


Microsoft Visual Studio

Windows Azure Tools for Microsoft Visual Studio

There was an error attaching the debugger to the IIS worker process for URL 'http://127.255.0.0:82/' for role instance 'deployment16(315).Cloud.AnotherHttpHandler_IN_0'. Unable to start debugging on the web server. See help for common configuration errors. Running the web page outside of the debugger may provide further information.

Make sure the server is operating correctly. Verify there are no syntax errors in web.config by doing a Debug.Start Without Debugging. You may also want to refer to the ASP.NET and ATL Server debugging topic in the online documentation.



I have even put the Handler under System.webServer as well in the web.config file, see below code

<system.web>
<httpHandlers>
  <add verb="*" path="http-bind/*"
    type="HelloWorldHandler"/>
</httpHandlers>
</system.web>

<system.webServer>
<handlers>
  <add verb="*" path="http-bind/*" name="HelloWorldHandler" type="HelloWorldHandler"/>
</handlers>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>

I don't know what restricts it over the cloud environment.


Solution

  • Please take a look at this question to see how to configure httpHandlers for running in Azure.

    Most importantly - remove the httpHandlers section under the system.web and leave only handlers under system.webServer. Then add also the resourceType="Unspecified" attribute to the handler declaration. This should solve your issue.