Yes, it is possible to register a custom file extension and have it work with the existing .NET runtime. You can perform the following steps.
You need to add a ScriptMap in IIS (assuming IIS 7) and point it to the ASP.NET runtime so that IIS can forward the request to the correct processor.
- In IIS7 go to your website, or IIS root to register at the server level
- Under the IIS group go to Handler Mappings
- Under Actions click Add Script Map
- Set Request Path to *.xxxx
- Set Path to the ASP.NET runtime (%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll) or whatever version you are running.
Then you will need to register a custom build provider for the file extension so that the .NET runtime can pre-compile your code assuming you wanted it to work similar to a *.asmx service.
Here are a list of some the built in build providers:
<system.web>
<compilation>
<buildProviders>
<add extension=".aspx" type="System.Web.Compilation.PageBuildProvider" />
<add extension=".ascx" type="System.Web.Compilation.UserControlBuildProvider" />
<add extension=".master" type="System.Web.Compilation.MasterPageBuildProvider" />
<add extension=".asix" type="System.Web.Compilation.ImageGeneratorBuildProvider" />
<add extension=".asmx" type="System.Web.Compilation.WebServiceBuildProvider" />
<add extension=".ashx" type="System.Web.Compilation.WebHandlerBuildProvider" />
<add extension=".soap" type="System.Web.Compilation.WebServiceBuildProvider" />
<add extension=".resx" type="System.Web.Compilation.ResXBuildProvider" />
<add extension=".resources" type="System.Web.Compilation.ResourcesBuildProvider" />
<add extension=".wsdl" type="System.Web.Compilation.WsdlBuildProvider" />
<add extension=".xsd" type="System.Web.Compilation.XsdBuildProvider"/>
<add extension=".js" type="System.Web.Compilation.ForceCopyBuildProvider" />
</buildProviders>
</compilation>
</system.web>
You can most likely just copy one of the existing build providers based on the one that best matches what you are doing and register it in your applications web.config
<system.web>
<compilation>
<buildProviders>
<add extension=".xxxx" type="System.Web.Compilation.WebServiceBuildProvider" />
</buildProviders>
</compilation>
</system.web>