I have a ashx file in a asp.net web project. It has a code behind cs file. The cs file is compiled into project dll & deployed to production. I found no way to dynamically change the cs file without deploying the whole project dll.
I have been putting c# code into aspx (not .cs) file, after deployment, I can make change to a single aspx file, and deploy, IIS can dynamically compile & merge with its code behind c# code.
Can I do the similar thing with ashx file?
Here is a quote from MSDN. http://msdn.microsoft.com/en-us/library/ms366723(v=vs.100).aspx
ASP.NET supports the dynamic compilation of ASP.NET pages (.aspx files), ASP.NET Web services (.asmx files), ASP.NET HTTP handlers (.ashx files)
thanks, this can save me lots of time!
I figured it out.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
public class Handler1 : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
context.Response.Write("Hello World2");
}
public bool IsReusable
{
get
{
return false;
}
}
}