Is it possible to host a web-service and an ASP.NET app on the same AppDomain?
===

I have added some [web methods][1] to my ASP.NET page like the following to enable [AJAX calls using jQuery][2] on the client side of my application:

    public partial class MyPage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            // Page load logic...
        }
 
        [WebMethod]
        [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
        public static string MyWebMethod()
        {
            // web method logic...
        }
    }

However, I noticed using the debugger that my web methods are being processed on a different [AppDomain][3] than my ASP.NET Page's AppDomain, hence each one of them has its own set of static variables which is causing me some trouble.

So I would like to know if it's somehow possible to host a web-service and an ASP.NET app on the same AppDomain, enabling both of them access to the same set of static variables?

Thanks in advance! 


  [1]: http://msdn.microsoft.com/en-us/library/byxd99hx%28v=vs.90%29.aspx
  [2]: http://api.jquery.com/jQuery.ajax/
  [3]: http://msdn.microsoft.com/en-us/library/system.appdomain.aspx