I have a significant webform project that needs MVC4 integrated into it. MVC controllers etc.. are working fine. However i am not getting the MVC type context menu items e.g. add view when right click a controller method (see below - this is the add view that I want to see. It is missing from my project).

enter image description here

I have tried creating a blank MVC project then swapping out the web form csproj file for this and readding in all the webform elements but it broke the site in all manner of ways that i don't have time to resolve. I really don't want to go down this rabbit hole in any case - i suspect it's the wrong approach.

I have tried adding in (what i believe to be) the correct projecttype guid into the csprojj file by editing with a text editor i.e.

<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};
{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>

becomes

<ProjectTypeGuids>{E3E379DF-F4C6-4180-9B81-6769533ABE47};
{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
</ProjectTypeGuids>

but i still do not get the correct context menu items.

Can anyone tell me what I am missing?

Many Thanks for all help

Edit

This link gives an example for MVC3 and gives an idea of what I am trying to achieve. But the project type guid crashes the site (because it is MVC3) and my own efforts aren't working

http://www.britishdeveloper.co.uk/2011/05/convert-web-forms-mvc3-how-to.html

Further details i think are probably irrelevant

The project is an install of EPiServer Relate+ 7. A new site is starting from this but the majority of the site itself will be MVC (i hope). But we will use the re-existing web form elements for community type pages. There is no time or budget to convert these.

I don't think this is relevant to the solution. I think the problem is generic rather than particular to EPiServer.

有帮助吗?

解决方案

Embarrassing!!!

I nearly got this right. I just needed to restart Visual Studio when I changed the project type Guid

So - the project type Guid for MVC4 is

{E3E379DF-F4C6-4180-9B81-6769533ABE47};

and the full element is

<ProjectTypeGuids>{E3E379DF-F4C6-4180-9B81-6769533ABE47};
{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
</ProjectTypeGuids>

BUT - don't forget to restart Visual Studio (Doh!!!)

I'll keep this question up in case others have got the same problem

Thanks for everyone's time

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top