Geeks With Blogs

News Opinions and articles on this blog are mine alone and do not represent my employer. All articles and blog entries are posted using a personal computer system outside of my employer network.
Sam Abraham Software Engineer/Architect: Putting Customers First
(UPDATED 2/26/2011 with higlighted information) I previously blogged on running ASP.Net MVC in an ASP.Net WebForms project. My reference at the time was a freely-available PDF document by Scott Guthrie which covered the setup process in good detail.
 
As I am preparing references to share with our audience at my upcoming talk at the Deerfield Beach Coders Café on March 1st (http://www.fladotnet.com/Reg.aspx?EventID=514), I found a nice blog post by Scott Hanselman on running both ASP.Net 4.0 WebForms along with ASP.Net MVC 3.0 in the same project. You can access this article here.
 
Moreover, Scott later followed-up with a blog showing how to leverage NuGet to automate the setup of ASP.Net MVC3 in an existing ASP.Net WebForms project.
 
One frequent question that usually comes up when discussing this side-by-side setup is the loss of the convenient Visual Studio Solution Explorer context menu which enable us to easily create controllers and views with a few mouse clicks.
 
A good suggestion brought up in the comments section of Scott’s article presented a good work-around to this problem: Manually add the MVC Visual Studio Project Type GUID in your .csproj project file ({E53F8FEA-EAE0-44A6-8774-FFD645390401}) which then brings back the MVC-specific context menu functionality in solution explorer of the hybrid project. (Thanks James Raden!)
 
Below is how James presented his solution. Note that I was only able to get this to work when I added the project Type GUID at the beginning of the GUID list.
 
<ProjectTypeGuids>{E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
 

 

Posted on Thursday, February 24, 2011 1:05 PM Fladotnet.com , Tech Talk , VS2010 , ASP .Net MVC 3 , ASP.Net MVC 3 Beta , Razor Pages , ASP.Net Web Pages , MVC 3 , NuPack , NuGet , ASP.Net 4.0 , .Net 4.0 , ASP.Net , webdev , IIS7 | Back to top


Comments on this post: Updated: Running ASP.Net MVC3 Alongside ASP.Net WebForms in the Same Project

# re: Updated: Running ASP.Net MVC3 Alongside ASP.Net WebForms in the Same Project
Requesting Gravatar...
Thanks for the info! Very helpful! :-)

Btw: General Comment, black text on dark blue background is difficult to read.
Left by C on Apr 10, 2011 7:52 PM

# re: Updated: Running ASP.Net MVC3 Alongside ASP.Net WebForms in the Same Project
Requesting Gravatar...
Thanks C. Noted :)
Left by Sam Abraham on Apr 10, 2011 8:28 PM

Your comment:
 (will show your gravatar)


Copyright © Sam Abraham | Powered by: GeeksWithBlogs.net