Why can't Visual Studio preview MVC Razor View (.cshtml) pages similar to asp/aspx pages?
It is indeed just a case of Razor being so new. No doubt preview will work with Razor in a future version (who knows, perhaps a service pack to 2010 will add this). However, as @marcind points out, this is speculation on my side...
Rich Bianco
Available to help with PowerBuilder Projects 25+ years nearly-dedicated PB Broad range of ancillary languages Full Life Cycle, Sprint, Jira, Trello All Major DBMS, Oracle my Favorite Visual Source Safe, some Git Fair, Trustworthy, Confident Seasoned, Steady, Focused Rate is competitive in ball park of sixty five depending on everything. You would expect a high level of competency with PowerBuilder, moderate DB design, all major DBMS's, and many common languages and tools.
Updated on June 08, 2022Comments
-
Rich Bianco almost 2 years
I enjoy working with ASP.NET MVC 3 using the Razor view engine, but am embarrassed to admit that not having the ability to preview the pages (.cshtml) in the Visual Studio designer negatively affects my productivity.
Is there a fundamental reason why Visual Studio won't preview Razor pages or is it simply a matter of Razor being relatively new (and released out of band), in which case we might expect preview in Visual Studio 2012?
-
marcind almost 13 yearsCommenting here since this answer is marked as the solution. In fact, it's nothing more than speculation. There are currently no plans to add a Razor designer to Visual Studio 2010.
-
Tae-Sung Shin about 11 yearsOf course, it will increase productivity with a right designer. Can you imagine expression blend for asp.net mvc? But reality is that there is no single web design software that can do it. At this point, the only way is to open whole page in a series of browsers. That's a pain.
-
Rich Bianco almost 8 yearsI was re-reading this, wow this was six years ago so definitely no plans for razor preview unless it's already possible and I haven't seen it.
-
Marc Roussel about 5 yearsIt's possible with RenderRazorViewToString. If you search the web, there's a small code used by many this small code can be used to make an extension in VS that would let you right click a .cshtml and have an option Preview which of course would have fake data merged with the view. I only speculate. You can even find many examples on stackoverflow already and this is just a google search result for you in a not too english version : gist.github.com/Draw507/330e907ddbec85e3d5c2f07f5c9a2a0e
-
Shimmy Weitzhandler almost 5 yearsAny news as of VS 2019?