Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8385873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:46:35+00:00 2026-06-09T17:46:35+00:00

I have a servicestack server that uses a response filter to add data validation

  • 0

I have a servicestack server that uses a response filter to add data validation messages to our service. My Put/Post handlers return a HttpResult object with Response set to our validation object. The response filter then decomposes this object into a raw html string that it sets the Response object to. In order to get this to work I had to create a String.md file in “views” along with a blank html template file. The problem I am now seeing is when our custom html response contains a comma “,” the jsv fromater tries to serialize the string and throws an exception:

   at System.String.get_Chars(Int32 index)
   at ServiceStack.Text.Jsv.JsvTypeSerializer.EatMapKey(String value, Int32& i)
   at ServiceStack.Text.Common.DeserializeDictionary`1.ParseStringDictionary(String value)
   at ServiceStack.Text.Jsv.JsvReader`1.Parse(String value)
   at ServiceStack.Text.TypeSerializer.DeserializeFromString[T](String value)
   at ServiceStack.Html.ViewDataDictionary.PopulateModelState()
   at ServiceStack.Html.HtmlHelper.Init(IViewEngine viewEngine, ViewDataDictionary viewData)
   at ServiceStack.Html.HtmlHelper.Init(MarkdownPage markdownPage, Dictionary`2 scopeArgs, Boolean renderHtml, ViewDataDictionary viewData)
   at ServiceStack.Markdown.MarkdownViewBase.Init(IAppHost appHost, MarkdownPage markdownPage, Dictionary`2 scopeArgs, Object model, Boolean renderHtml)
   at ServiceStack.WebHost.Endpoints.Support.Markdown.MarkdownPage.Write(TextWriter textWriter, PageContext pageContext)
   at ServiceStack.WebHost.Endpoints.Support.Markdown.TemplateExtensions.RenderToString(MarkdownPage markdownPage, Dictionary`2 scopeArgs, Boolean renderHtml)
   at ServiceStack.WebHost.Endpoints.Formats.MarkdownFormat.RenderDynamicPage(MarkdownPage markdownPage, Dictionary`2 scopeArgs, Boolean renderHtml, Boolean renderTemplate)
   at ServiceStack.WebHost.Endpoints.Formats.MarkdownFormat.RenderDynamicPage(MarkdownPage markdownPage, String pageName, Object model, Boolean renderHtml, Boolean renderTemplate)
   at ServiceStack.WebHost.Endpoints.Formats.MarkdownFormat.ProcessMarkdownPage(IHttpRequest httpReq, MarkdownPage markdownPage, Object dto, IHttpResponse httpRes)
   at ServiceStack.WebHost.Endpoints.Formats.MarkdownFormat.<Register>b__1(IRequestContext requestContext, Object dto, IHttpResponse httpRes)
   at ServiceStack.WebHost.Endpoints.Formats.HtmlFormat.<>c__DisplayClass1.<SerializeToStream>b__0(StreamSerializerResolverDelegate x)
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at ServiceStack.WebHost.Endpoints.Formats.HtmlFormat.SerializeToStream(IRequestContext requestContext, Object dto, IHttpResponse httpRes)
   at ServiceStack.Common.Web.HttpResponseFilter.SerializeToStream(IRequestContext requestContext, Object response, Stream responseStream) in i:\GitHub\ServiceStack\src\ServiceStack.Common\Web\HttpResponseFilter.cs:line 152
   at ServiceStack.Common.Web.HttpResult.WriteTo(Stream responseStream) in i:\GitHub\ServiceStack\src\ServiceStack.Common\Web\HttpResult.cs:line 219
   at ServiceStack.WebHost.Endpoints.Extensions.HttpResponseExtensions.WriteToOutputStream(IHttpResponse response, Object result, Byte[] bodyPrefix, Byte[] bodySuffix)
   at ServiceStack.WebHost.Endpoints.Extensions.HttpResponseExtensions.WriteToResponse(IHttpResponse response, Object result, ResponseSerializerDelegate defaultAction, IRequestContext serializerCtx, Byte[] bodyPrefix, Byte[] bodySuffix)

My question is how can i turn jsv off for these responses? Or is there a better way to return raw html? I cannot have my request handlers return a string since I need to control the response code and headers returned.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T17:46:36+00:00Added an answer on June 9, 2026 at 5:46 pm

    You can return a HTML string inside a HttpResult, e.g:

    return new HttpResult("<html>...</html>", ContentType.Html);
    

    For referemce ServiceStack’s HTML Story can be found at:

    Is it possible to serve HTML pages with ServiceStack?

    In addition to Markdown, we’ve added new MVC Razor Support you can see examples of at in:

    • Razor Rockstars – with Razor views embedded in stand-alone self-host
    • Inside ASP.NET host
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ServiceStack REST service (PUT and POST) which I have tested with
have created REST service using servicestack and in post request I have return object
I have constructed a simple Rest service using ServiceStack (which is brilliant), that returns
I have built a service with ServiceStack (customer example) as per this link: https://docs.google.com/present/view?id=dg3mcfb_213gsvvmmfk
We have a legacy server code that we want to abandon and develop new
I have a service stack service with the following request and response classes in
Have you ever seen any of there error messages? -- SQL Server 2000 Could
I have a web service in WCF that consume some external web services, so
I have just started to use ServiceStack which is an amazing library. However, I
Have a painfully simple blog Post creator, and I'm trying to check if the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.