I have an existing web application that contains a couple of WCF services, but today I also wanted to add some pages and decided that I wanted to create them with ASP.NET MVC2. This is the steps I took to get the MVC pages to run just fine in my existing application.
Please note that the exact GUID will be different for ASP.NET MVC3 (I assume this anyway). Read more: Eric's Blog
- First of all I added references to System.Web.Mvc and System.Web.Routing
- I created a dummy MVC project so that I could see what was missing in my existing project.
- Then I created the convention based folder structure. Except for the minimum required folders of Controllers and Views, I also added Scripts, Content and Model folders.
- I copied all the java script files from the dummy project to my Scripts folder.
- I added a Global.asax file to my project and copied the content from Global.asax in the dummy project, but of course corrected the default route.
- I opened up the dummy project file in Notepad, and the same with my existing project file. In the project files I looked for the <ProjectTypeGuids> and compared them. For ASP.NET MVC2 the {F85E285D-A4E0-4152-9332-AB1D724D3325} GUID was missing so I changed from:
to:<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<ProjectTypeGuids>{F85E285D-A4E0-4152-9332-AB1D724D3325};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
Please note that the exact GUID will be different for ASP.NET MVC3 (I assume this anyway). Read more: Eric's Blog
0 comments:
Post a Comment