<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx</link><description>Update : Please read this post for the newest and greatest. A couple weeks ago, I blogged about using a Build provider and CodeDom to generate strongly typed MVC helpers at runtime. I followed up a few days later with another version that used T4 templates</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9769697</link><pubDate>Wed, 17 Jun 2009 18:54:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9769697</guid><dc:creator>barryd</dc:creator><description>&lt;p&gt;Hmm, maybe you could add a custom action to the compile that simply touches the TT file?&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9769777</link><pubDate>Wed, 17 Jun 2009 19:17:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9769777</guid><dc:creator>Rob</dc:creator><description>&lt;p&gt;Nice article. Few bits I'll be using for sure.&lt;/p&gt;
&lt;p&gt;I was using extension methods for Redirect Links, sort of like:&lt;/p&gt;
&lt;p&gt;RedirectTo&amp;lt;UserController&amp;gt;(u =&amp;gt; u.Index());&lt;/p&gt;
&lt;p&gt;Same for working out a form url, or building my routes etc...&lt;/p&gt;
&lt;p&gt;Your way obviously reads more cleanly though. Definitely like the View(&amp;quot;Something&amp;quot;) fix. I hadn't done anything for that yet.&lt;/p&gt;
&lt;p&gt;Re the above comment, just add a pre build action:&lt;/p&gt;
&lt;p&gt;&amp;quot;C:\Program Files\Common Files\Microsoft Shared\TextTemplating\1.2\TextTransform&amp;quot; &amp;quot;$(SolutionDir)\MyTemplate.tt&amp;quot; -out &amp;quot;$(SolutionDir)\Output.cs&amp;quot;&lt;/p&gt;
&lt;p&gt;We also run it in our NAnt build scripts, pre compile.&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9769787</link><pubDate>Wed, 17 Jun 2009 19:24:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9769787</guid><dc:creator>PabloBlamirez</dc:creator><description>&lt;p&gt;This is a massive improvement. I'd tried the same but had been failing at the lack of reflection, I was going to look into the Common Compiler Infrastructure API to see if introspection rather than reflection would have been any more use but I don't need to now - so thanks!&lt;/p&gt;
</description></item><item><title>Pre-build step to transform T4 templates.</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9769800</link><pubDate>Wed, 17 Jun 2009 19:34:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9769800</guid><dc:creator>MelGrubb</dc:creator><description>&lt;p&gt;Check my blog post for how to set up a pre-build step.&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://melgrubb.spaces.live.com/blog/cns"&gt;http://melgrubb.spaces.live.com/blog/cns&lt;/a&gt;!A44BB98A805C8996!256.entry&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9769943</link><pubDate>Wed, 17 Jun 2009 20:50:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9769943</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Thanks for the suggestions on forcing the T4 generation at build time. Unfortunately, they don't quite appear to work:&lt;/p&gt;
&lt;p&gt;Barryd suggested 'touching' the .tt file: the problem is that VS only seems to rerun the .tt file when it's modified from within VS. So using an external touch.exe has no effect. Maybe there is a way to ask VS to resave the file.&lt;/p&gt;
&lt;p&gt;Rob and Mel suggested running TextTransform.exe as a prebuild step: while this works for some T4 templates, it won't work for this one because it uses services from the VS Host, which are not available when using the cmd line tool. &amp;nbsp;Specifically, the template calls:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;// Get the DTE service from the host&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;var dte = (DTE)((IServiceProvider)Host).GetService(typeof(SDTE));&lt;/p&gt;
&lt;p&gt;We'll find some way to make this work! :)&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9769981</link><pubDate>Wed, 17 Jun 2009 21:07:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9769981</guid><dc:creator>Eric Hexter</dc:creator><description>&lt;p&gt;I am glad to see that the design time approach is looking better. &amp;nbsp;After exploring this myself the design time approach feels better and works with some of the add-ins better than the runtime approach.&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9772694</link><pubDate>Thu, 18 Jun 2009 07:29:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9772694</guid><dc:creator>Thanigainathan</dc:creator><description>&lt;p&gt;A fantastic Article .Is that possible to use the Sql Server for generating the front end and would that solve the problem ?&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9772728</link><pubDate>Thu, 18 Jun 2009 07:39:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9772728</guid><dc:creator>Shiju Varghese</dc:creator><description>&lt;p&gt;The design time approach is really cool.&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9775852</link><pubDate>Thu, 18 Jun 2009 15:44:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9775852</guid><dc:creator>cowgaR</dc:creator><description>&lt;p&gt;well, isn't that deprecated with the help of strongly typed HTML helpers using lambda syntax out there (from contrib to google)?&lt;/p&gt;
&lt;p&gt;you can even make some for yourself, I might be wrong but can someone enlighten me why would I use these T4 instead of getting better HTML helpers?&lt;/p&gt;
&lt;p&gt;thanks&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9776107</link><pubDate>Thu, 18 Jun 2009 17:09:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9776107</guid><dc:creator>Rick</dc:creator><description>&lt;p&gt;You should be able to right-click a .tt file in the solution manager and &amp;quot;run custom tool&amp;quot; instead of re-saving, to manually trigger regeneration.&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9776365</link><pubDate>Thu, 18 Jun 2009 18:22:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9776365</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;cowgaR: Lambda based solutions do provide an alternative, but with several drawbacks:&lt;/p&gt;
&lt;p&gt;- The syntax is more complex. Personally I don't mind it, but I heard that from many people&lt;/p&gt;
&lt;p&gt;- It has some perf issues&lt;/p&gt;
&lt;p&gt;- It has no support for View Names&lt;/p&gt;
&lt;p&gt;In the end, use what works best for you!&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9776369</link><pubDate>Thu, 18 Jun 2009 18:23:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9776369</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Rick: yes, you can right click instead of Saving. In any case, it's still a manual step that would ideally be automated.&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9776915</link><pubDate>Thu, 18 Jun 2009 21:08:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9776915</guid><dc:creator>Richard</dc:creator><description>&lt;p&gt;I have added the Mvc-CodeGen.tt file to the root of my MVC project (it is right in between the Global.asax and Web.config) but I keep getting this error: &amp;quot;Running transformation: Could not find the VS Project containing the T4 file. It needs to be at root of the project.&amp;quot;&lt;/p&gt;
&lt;p&gt;I am sure that I am doing or missing something stupid but for the life of me, I can't see what it is.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9776969</link><pubDate>Thu, 18 Jun 2009 21:22:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9776969</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Richard: I have not seen this, but I haven't tried it on that many projects. If you can zip up your project (or a simplified version of up) and email it to me (david.ebbo @ microsoft.com), I'll be glad to take a look.&lt;/p&gt;
</description></item><item><title>David Ebbo's blog : A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9778150</link><pubDate>Fri, 19 Jun 2009 04:04:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9778150</guid><dc:creator>DotNetBurner - ASP.net MVC</dc:creator><description>&lt;p&gt;DotNetBurner - burning hot .net content&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9792065</link><pubDate>Fri, 19 Jun 2009 23:33:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9792065</guid><dc:creator>Richard</dc:creator><description>&lt;p&gt;David, thank you very much for your offer but I think that I have found the problem. The MVC project in my solution is in a Solution Folder which seems to be the source of the problem. I made a copy of the project into a new blank solution, in preparation to send it to you. Of course, the T4 template started working. So I created a solution folder and moved the project to the solution folder. Attempting to run the template again caused the same error that I mentioned before about not being at the root of the project.&lt;/p&gt;
&lt;p&gt;By the way, I think what you have done is great and I can't wait to get it working.&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9792511</link><pubDate>Sat, 20 Jun 2009 04:22:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9792511</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Richard, thanks for reporting this issue. I put in a fix so it should now work inside solution folders. Please let me know how that works for you.&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9797467</link><pubDate>Mon, 22 Jun 2009 14:06:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9797467</guid><dc:creator>Felipe Fujiy</dc:creator><description>&lt;p&gt;Just to confirm. This T4 methods have same performance that HtmlHelpers?&lt;/p&gt;
&lt;p&gt;This approach is perfect! I will implement in my MVC applications!!&lt;/p&gt;
&lt;p&gt;Resave, and no refactor is a little bit.&lt;/p&gt;
&lt;p&gt;Thx&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9797469</link><pubDate>Mon, 22 Jun 2009 14:15:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9797469</guid><dc:creator>Felipe Fujiy</dc:creator><description>&lt;p&gt;I founded a bug.&lt;/p&gt;
&lt;p&gt;If a have a controller AbcController with a method Abc() generated code creates a Abc class, with a method Abc(Member names cannot be the same as their enclosing type)&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9797891</link><pubDate>Mon, 22 Jun 2009 19:18:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9797891</guid><dc:creator>Richard</dc:creator><description>&lt;p&gt;David, the fix worked and got rid of the project root error when using a solution folder. However, I ran into another issue like the Felipe reported above.&lt;/p&gt;
&lt;p&gt;I have a controller supertype that is named such that when a class is generated using the name of the supertype minus the word controller, it results in conflicts with the root namespace of the project:&lt;/p&gt;
&lt;p&gt;MVC Project Namespace: SomeName.Mvc&lt;/p&gt;
&lt;p&gt;Controller Supertype: SomeNameController&lt;/p&gt;
&lt;p&gt;Generated Code Contains Class Named: SomeName &lt;/p&gt;
&lt;p&gt;This causes conflicts elsewhere in the generated code.&lt;/p&gt;
&lt;p&gt;I can take care of this with renaming or moving the supertype declaration out of the Controllers folder, but I thought that I would mention it just the same. &lt;/p&gt;
&lt;p&gt;Still love the work - keep it up!&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9798656</link><pubDate>Tue, 23 Jun 2009 04:53:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9798656</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Felipe: yes, using this T4 should have no perf impact. In fact, it's a bit faster than using anonymous objects.&lt;/p&gt;
&lt;p&gt;Felipe and Richard: I fixed the name class issue by appending an underscore when it would conflict. &amp;nbsp;e.g. the method would be called SomeName_(). Not pretty, but hopefully it's not super common.&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9798751</link><pubDate>Tue, 23 Jun 2009 06:55:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9798751</guid><dc:creator>Rahul Ravindran</dc:creator><description>&lt;p&gt;I am trying to get this to work in VS2010 Beta 1 + MVC (installed with the OOB MVC Installer).&lt;/p&gt;
&lt;p&gt;I get this error: &amp;quot;Running transformation: System.Runtime.Serialization.SerializationException: Type 'Microsoft.VisualStudio.CSharp.Services.Language.CodeModel.CEnumerator' in Assembly 'Microsoft.VisualStudio.CSharp.Services.Language, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable.&amp;quot;&lt;/p&gt;
&lt;p&gt;After some investigation, the error seems to be propping up in this iteration: &amp;quot;foreach (CodeNamespace ns in GetNamespaces(item.FileCodeModel.CodeElements))&amp;quot; in the ProcessAllControllers method. The iteration simply fails with the above error.&lt;/p&gt;
&lt;p&gt;I can confirm this is not anything specific to my project. I tried this on NerdDinner and got the same error.&lt;/p&gt;
&lt;p&gt;Has anyone been able to get this working with VS2010 Beta 1?&lt;/p&gt;
&lt;p&gt;(I can post a full stack trace if needed.)&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9798889</link><pubDate>Tue, 23 Jun 2009 08:10:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9798889</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Rahul: I had not tried with VS2010, but I just did and I see the same thing as you. It looks like some kind of VS breaking change. I will contact the experts in that area to help investigate.&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9798961</link><pubDate>Tue, 23 Jun 2009 10:11:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9798961</guid><dc:creator>John Sheehan</dc:creator><description>&lt;p&gt;These are working great, nice work David.&lt;/p&gt;
&lt;p&gt;One comment on the organization. Is it feasible to organize the classes in a more hierarchal manner? e.g. MVC.Views.Shared.XYZ and MVC.Controllers.Home.Index() and so forth. I kept finding myself typing it this way and it seems more logical to me since the scope narrows after each dot. Just a thought. Either way, I love it so far and look forward to any enhancements you come up with.&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9799639</link><pubDate>Tue, 23 Jun 2009 18:40:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9799639</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;John, the reasoning I made is that the controller is the root, in the sense that Actions and Views belong to a Controller (except for Shared views, which break this rule).&lt;/p&gt;
&lt;p&gt;But granted there are more than one right way of organizing this. I can certainly change it if there is demand :)&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9800334</link><pubDate>Wed, 24 Jun 2009 01:18:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9800334</guid><dc:creator>Roberto Hernandez</dc:creator><description>&lt;p&gt;I don't see the implementation of the,&lt;/p&gt;
&lt;p&gt;return RedirectToAction(MVC.Dinners.Details(dinner.DinnerID));&lt;/p&gt;
&lt;p&gt;I don't think is in the included template.&lt;/p&gt;
&lt;p&gt;Regards, &lt;/p&gt;
&lt;p&gt;Roberto&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9800340</link><pubDate>Wed, 24 Jun 2009 01:25:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9800340</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Roberto, make sure you make your controller class partial to get the RedirectToAction method. &amp;nbsp;This is mentioned in the post, but I guess it's easy to miss! :)&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9804624</link><pubDate>Fri, 26 Jun 2009 05:17:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9804624</guid><dc:creator>AdamR</dc:creator><description>&lt;p&gt;Thanks for the nice tool. An idea:&lt;/p&gt;
&lt;p&gt;How about spitting out the fully ~ qualified path to the view rather than just its name? This would help us avoid some mildly annoying (but handled) runtime FileNotFoundExceptions related to the default path resolution strategy when developing.&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9805301</link><pubDate>Fri, 26 Jun 2009 15:09:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9805301</guid><dc:creator>Felipe Fujiy</dc:creator><description>&lt;p&gt;Hey David, I have a suggestion.&lt;/p&gt;
&lt;p&gt;When Controller isn&amp;#180;t partial class, we have another options:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;public static class Example&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public static void RedirectToAction(this Controller controller, ControllerActionCallInfo any)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;The can use: this.RedirectToAction(MVC.MyController.Show(&amp;quot;1&amp;quot;))&lt;/p&gt;
</description></item><item><title>Supporting view names like "view-name"</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9805686</link><pubDate>Fri, 26 Jun 2009 19:49:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9805686</guid><dc:creator>Jason Abbott</dc:creator><description>&lt;p&gt;The generated class will have errors if you happened to use hyphens in any view names. A straight replacement is simple but this is a bit more thorough (around line 64 of version 0.9.0006):&lt;/p&gt;
&lt;p&gt;public static class Views {&lt;/p&gt;
&lt;p&gt;&amp;lt;# foreach (string view in controller.Views) { #&amp;gt;&lt;/p&gt;
&lt;p&gt;public const string &amp;lt;#= Regex.Replace(&lt;/p&gt;
&lt;p&gt; &amp;nbsp; view,&lt;/p&gt;
&lt;p&gt; &amp;nbsp; @&amp;quot;\W*\b(\w)&amp;quot;,&lt;/p&gt;
&lt;p&gt; &amp;nbsp; m =&amp;gt; m.Groups[1].Value.ToUpper(),&lt;/p&gt;
&lt;p&gt; &amp;nbsp; RegexOptions.IgnoreCase) #&amp;gt; = &amp;quot;&amp;lt;#= view #&amp;gt;&amp;quot;;&lt;/p&gt;
&lt;p&gt;&amp;lt;# } #&amp;gt;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9805924</link><pubDate>Fri, 26 Jun 2009 23:17:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9805924</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Jason: I fixed that character issue and posted the update on CodePlex (now version 2.0.01). I just went with a straight replacement to '_' for now.&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9806482</link><pubDate>Sat, 27 Jun 2009 11:48:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9806482</guid><dc:creator>cowgaR</dc:creator><description>&lt;p&gt;@David: thanks for an answer, I will digg to it today as I have some time, guess I'll start with the first article on the topic.&lt;/p&gt;
&lt;p&gt;just a quick check before I understand your approach (if it's worth for me).&lt;/p&gt;
&lt;p&gt;Do I get strongly typed checks as I am getting using lambda syntax html helpers (performance is NOT a problem, its drawback is NON EXISTENT in a real world application, where all is about the DB)?&lt;/p&gt;
&lt;p&gt;As this is the main advantage, having compiler find any &amp;quot;string related&amp;quot; bugs...you know, kill those pesky strings :)&lt;/p&gt;
&lt;p&gt;going to read couple of blog post now, thanks for your work anyway&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9806498</link><pubDate>Sat, 27 Jun 2009 11:57:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9806498</guid><dc:creator>cowgaR</dc:creator><description>&lt;p&gt;ah well, judging just by a blog post name I read think I have an answer :)&lt;/p&gt;
</description></item><item><title>Visual Studio 2010 update</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9806755</link><pubDate>Sat, 27 Jun 2009 23:47:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9806755</guid><dc:creator>Chip Paul</dc:creator><description>&lt;p&gt;The enumeration of EnvDTE.CodeElements seems busted in 2010, but the MSDN page for CodeElements shows using a 1-based for loop to access it. &amp;nbsp;Try changing GetNamespaces to the following:&lt;/p&gt;
&lt;p&gt;// Return all the CodeNamespaces in the CodeElements collection&lt;/p&gt;
&lt;p&gt;public static IEnumerable&amp;lt;CodeNamespace&amp;gt; GetNamespaces(CodeElements codeElements) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; List&amp;lt;CodeNamespace&amp;gt; spaces = new List&amp;lt;CodeNamespace&amp;gt;();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; for (int i=0; i&amp;lt;codeElements.Count; i++) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; 		CodeNamespace possibleNamespace = codeElements.Item(i+1) as CodeNamespace;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; 		if (possibleNamespace != null) 	spaces.Add(possibleNamespace);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; return spaces;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9807127</link><pubDate>Sun, 28 Jun 2009 08:41:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9807127</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Chip: yes, there is a known issue in VS2010. I have changed the template to use a loop as you suggest. This actually applied to several places in the code. Anyway, it should work fine in VS2010 beta now. Please try the new drop on CodePlex (version 2.0.03). Thanks for you help!&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9808859</link><pubDate>Mon, 29 Jun 2009 22:28:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9808859</guid><dc:creator>Sajjad</dc:creator><description>&lt;p&gt;hi,&lt;/p&gt;
&lt;p&gt;Nice article, i tried your code its working genrally fine except i found one issue&lt;/p&gt;
&lt;p&gt;in &lt;/p&gt;
&lt;p&gt;GetProjectContainingT4File&lt;/p&gt;
&lt;p&gt;on line 187 you should check for projec.projectitems for null it was crashing in my project &lt;/p&gt;
&lt;p&gt; &amp;nbsp;else {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// It may be a solution folder. Need to recurse.&lt;/p&gt;
&lt;p&gt;		if(project.ProjectItems != null)&lt;/p&gt;
&lt;p&gt;		{&lt;/p&gt;
&lt;p&gt;			foreach (ProjectItem item in project.ProjectItems) {&lt;/p&gt;
&lt;p&gt;				if (item.SubProject == null)&lt;/p&gt;
&lt;p&gt;					continue;&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9809054</link><pubDate>Tue, 30 Jun 2009 03:23:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9809054</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Sajjad: fixed this issue in new build 2.1.00 (on CodePlex). Thanks!&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9809823</link><pubDate>Tue, 30 Jun 2009 20:23:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9809823</guid><dc:creator>hilton smith</dc:creator><description>&lt;p&gt;thanks man, this is awesome stuff.&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9810920</link><pubDate>Wed, 01 Jul 2009 15:35:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9810920</guid><dc:creator>Alexis Kennedy</dc:creator><description>&lt;p&gt;You are a god among men. This is exactly what I needed: I was trying to do something similar to avoid the lambda syntax that upsets people, but this is so far ahead of my primitive attempts that it just isn't funny. Thank you very much.&lt;/p&gt;
</description></item><item><title>re: A new and improved ASP.NET MVC T4 template</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx#9832097</link><pubDate>Mon, 13 Jul 2009 21:45:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9832097</guid><dc:creator>Kelly Bourg</dc:creator><description>&lt;p&gt;This is awesome...Kudos. &amp;nbsp;Is it possible to add in an &amp;quot;IgnoreOnRouteCreation&amp;quot; attribute to some parameters. &amp;nbsp;This would be useful when you are generating the rest of a url in javascript.&lt;/p&gt;
</description></item></channel></rss>