开发者

change webforms to mvc in visualstudio 2010

i created a blank webforms project instead of an MVC 3 project in 开发者_C百科visual studio, everything runs fine but i dont have my menues

for example when i right click on the Controllers folder i dont get "Add a controller" option.

does anyone know without starting a new project how to change the type of project into an MVC one so that i get the correct menus.

thanks


It's not that you don't have the menu options, it's that it's a completely different type of [web] application and works in different ways. e.g. Webforms has no concept of controllers so even if you did have a menu option it wouldn't get included in the project as you're expecting.

Because webForms and MVC are so different there could never be a 100% reliable conversion utility.

Just create a new project and copy the files already created. I can't imagine you've written that much code before realising that you're in WebForms, not MVC.

If you have got lots of WebForms code you could always just include this in the MVC project until you can convert it (if necessary) at a later time.

Edit:
If you just want to change the project type you can edit the csproj file of the webforms project and add the following ProjectTypeGuid {F85E285D-A4E0-4152-9332-AB1D724D3325};.
You'll need to update references, files, etc. for this to work but it may be quicker than creating a new project and copying content over. (Especially if you already have the project in source control.)

Note that I've only tested this going from WebForms 4 to MVC2.


Try updating a MVC to ASP.NET Fall Update Release Candidate. There is a link .

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜