In my ASP.Net MVC 4 application, there are several places where we are either manually rendering a view to a string or intercepting some part of the rendering pipeline. For example:
public static string RenderPartialViewToString(Controller controller, string viewName, object model)
{
controller.ViewData.Model = model;
try
{
using (System.IO.StringWriter sw = new System.IO.StringWriter())
{
var viewResult = ViewEngines.Engines.FindPartialView(controller.ControllerContext, viewName);
var viewContext = new ViewContext(controller.ControllerContext, viewResult.View, controller.ViewData, controller.TempData, sw);
viewResult.View.Render(viewContext, sw);
viewResult.ViewEngine.ReleaseView(controller.ControllerContext, viewResult.View);
return sw.GetStringBuilder().ToString();
}
}
catch (Exception ex)
{
return ex.ToString();
}
}
However, as of today, after installing the Visual Studio 2013 preview with .Net 4.5.1, we have noticed that the HTML returned to these functions contains a whole mess of garbage/debugging tags. such as the following:
<$A$> <$B$><$C$> <$D$> class="dashboard-content jobs-view active-jobs-view"
<$E$> data-activity-type="<$F$>Active<$G$>"<$H$>> <$I$> <$J$><$K$><$L$>
class="content-header" <$M$>> <$N$> <$O$><$P$> <$Q$> class="event-carousel-content"
<$R$>> <$S$> <$T$><$U$> <$V$> class="navbar candidate-summary-toolbar"<$W$>>
<$X$> class="navbar-inner"<$Y$>> <$Z$> class="nav-collapse collapse"<$a$>>
There doesn't seem to be any rhyme or reason to where they show up, except that the letter of the tag increases by one each time. These tags don't seem to make it to the response stream during the normal page lifecycle, though - only when we render them manually or intercept the pipeline somehow.
Does anybody have any idea what these tags are, where they came from and how to get rid of them?
Thanks!