1

Closed

(MVC Tools): Look for Area Views Folders when auto-selecting view engine

description

I'm not sure if this issue can be reported here or not - but I think it's likely that some people are getting a downgraded Visual Studio experience when upgrading a web forms application to incorporate MVC as well - particularly if they intend to use Razor as their default view engine.

Unless you've created a ~/Views folder in your WebForms + MVC hybrid project, ASPX will always be selected by default by the Add View dialog (on first showing - I know it remembers the last selected engine).

For the specifics of the issue please see this Q+A that I've just posted on Stackoverflow.

Whilst it's true that many such upgraded sites will probably have a ~/Views folder - I believe it's likely that some will be like us - and start off by doing everything in Areas. Because the Add New Item dialog doesn't look for an ~/Areas folder as well as a ~/Views folder, you have to create an empty Views folder in order to get Razor selected as the default view engine.

A simple change to the Microsoft.VisualStudio.Web.Mvc.UserInterface.MvcAddViewDialog.Init method to check both of these folder locations would fix the issue.
Closed Apr 15, 2013 at 10:18 PM by eilonlipton
The new Scaffolding feature we are building will have the user select their preferred view engine before getting to the scaffolding options. Because of that, there will be no auto-detection logic (and in particular, no broken auto-detection logic :) ), so this bug will effectively be fixed in the new release. Thanks for the report!

comments

HongmeiG wrote Feb 15, 2013 at 10:51 PM

we should look at if we should display razor as the default view engine.