NancyFx / Nancy

Lightweight, low-ceremony, framework for building HTTP based services on .Net and Mono
http://nancyfx.org
MIT License
7.15k stars 1.47k forks source link

Response.AsJson Throws Object reference not set to an instance of an object #2936

Closed ajp-sourceship closed 5 years ago

ajp-sourceship commented 5 years ago

I have a WCF Project that has Nancy. I am returning Response.AsJson but I get "Object reference not set to an instance of an object."

Does anyone know what I am doing wrong?

             try
            {

                var test = Response.AsJson(ret, HttpStatusCode.OK);
            }
            catch(Exception e )
            {
                 // test throws the error^^
            }