<%@ WebHandler Language="C#" Class="Default" %> using System; using System.Web; using Elisy.Web.Xap; public class Default : IHttpHandler { public void ProcessRequest (HttpContext context) { //The example of Xap Archiver use context.Response.ContentType = "application/x-zip-compressed"; Package xap = new Package(); xap.Files.Add(new File("AppManifest.xaml", context.Server.MapPath("~/Resources/AppManifest.xaml"))); xap.Files.Add(new File("Elisy.Barcode.dll", context.Server.MapPath("~/Resources/Elisy.Barcode.dll"))); xap.Files.Add(new File("TestBarcode.dll", context.Server.MapPath("~/Resources/TestBarcode.dll"))); xap.Write(context.Response.OutputStream); //Alternative ways to use HTTP-handler //1. To send pure Xaml uncomment the following block //context.Response.ContentType = "text/xml"; //context.Response.Write(""); //context.Response.Write(""); //context.Response.Write(""); //2.1 To return xap file uncomment the following block //context.Response.TransmitFile("~/Resources/TestBarcode.xap"); //2.2 Or uncomment the following block //context.Response.ContentType = "application/x-zip-compressed"; //context.Response.WriteFile("~/Resources/TestBarcode.xap"); } public bool IsReusable { get { return false; } } }