Generic Handler - Parser Error, Could not create type

1

Next person, I made a simple Generic Handler, just to give me back a person, just to mention, the code is this way

    public void ProcessRequest(HttpContext context)
    {
        context.Response.Cache.SetNoStore(); 
        context.Response.TrySkipIisCustomErrors = true;
        context.Response.ContentType = "application/json";
        context.Response.ContentEncoding = Encoding.UTF8;

        Pessoa p;
        p = new Pessoa();
        p.Nome = "Enzo";
        p.SobreNome = "Tiezzi";
        p.Idade = 19;
        //"{"Nome":"Enzo","SobreNome":"Tiezzi","Idade":19}"
        String json = new JavaScriptSerializer().Serialize(p);
        context.Response.Write(json);
        context.Response.StatusCode = 200;
    }

On my local server (IIS) it works normally, but when I put it on an online server it brings me the following error while accessing the .ashx directly:

    
asked by anonymous 05.01.2015 / 14:27

0 answers