ASP.NET MVC: Not That Open Source

ASP.NET MVC has one small hook into Visual Studio, the ability to right click and add views and controllers.

image

This feature is small, hell since I’ve been using spark I almost forgot about it, that is until I started working on a simple administration section. The application has enough entities that “Right Click –> Crud” would make just the right tool.

image

Idea

ASP.NET MVC provides customizable code templates for the view/controller content. There are a few really good articles on how to get started.

Plan

  1. Include the CodeTemplates in my project
  2. Change the output extention to .spark
    1. image
  3. Modify the markup to sparkup
  4. Phase 3: Profit.

Problem

ASP.NET MVC uses a custom tool to process the T4 templates.

MvcTextTemplateHost

It ignores the output extension directive in T4 templates.

(Click play)

http://media.entertonement.com/embed/OpenEntPlayer.swfThe Price is Right Losing Horns sound bite

Sadness

MvcTextTemplateHost is included in Microsoft.VisualStudio.Web.Extensions.dll and this DLL that is not “part” of MVC code that was open sourced.

Conclusion

I’d love to write a Visual Studio addin to create spark views but I just don’t have the time. However; I do wonder if I can just have spark parse the .aspx and .ascx files.