Description

This bug relates to the behaviour of the ViewEngineResult.Render method in VS2013 under MVC 5 however the problem is also present if I load a previously working MVC 4 project into VS2013.
In VS2012 we could use ViewEngineResult.Render to render a MVC view to a string. This was useful for generating emails from a View or for returning raw html to the client to incorporate into the UI client side using JS.
Under VS2013 this method is returning html strings containing malformed tags. For example the following is returned if you attempt to render the About.cshml page from the pre-canned app generated when creating a new MVC application in VS2013.
<$A$> <hgroup> <h2></$A$><$B$>About</$B$><$C$>.</h2> <h3></$C$><$D$>Test page for Render View test</$D$><$E$></h3> </hgroup> <div</$E$><$F$> class="row-fluid"</$F$><$G$>> <div</$G$><$H$> class="span12"</$H$><$I$>> <p>Use this area to provide additional information.</p> </div> </div></$I$>
Note this is generated using the iis express webserver included with VS. i have not tried to deploy this to a full iis server yet so not sure if the issue lies with VS or IIS Express? I have a small test application to demonstrate the error if needed.

Assign To

Thank you for reporting this issue. This issue has been fixed in Visual Studio 2013. You can install a trial version of Visual Studio 2013 with the fix from: http://go.microsoft.com/?linkid=9832436

Posted by Nonstick101 on 7/24/2013 at 6:01 PM

I can confirm that the workaround of turning off the "Browser Link" feature does indeed fix this error. Interesting little little bug, not an immediately obvious link between the two features. Looking forward to the next release.

Posted by Microsoft on 7/24/2013 at 12:23 PM

Thanks for reporting this issue. The good news is that we have fixed this issue in our upcoming release. For now, the workaround is to disable the Browser Link feature. For more details on how to disable this you can see here - http://blogs.msdn.com/b/webdev/archive/2013/06/28/browser-link-feature-in-visual-studio-preview-2013.aspx.

Regards,The ASP .Net Feature Team

Posted by A Gwynn on 7/22/2013 at 12:37 PM

I am also able to reproduce the error when opening a VS 2012 MVC 4 project in VS 2013. By switching back to VS 2012 the HTML string renders correctly.

Posted by Microsoft on 7/21/2013 at 10:58 PM

Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.

Posted by Nonstick101 on 7/17/2013 at 1:01 PM

Also just replicated the error on another machine with a fresh install of VS2013.