<?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>The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx</link><description>Short version : the MVC T4 template (now named T4MVC) is now available on CodePlex, as one of the downloads in the ASP.NET MVC v1.0 Source page . Go to T4MVC home page Poll verdict: it’s ok for T4MVC to make small changes Yesterday, I posted asking how</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9805742</link><pubDate>Fri, 26 Jun 2009 21:00:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9805742</guid><dc:creator>Chad Kranz</dc:creator><description>&lt;p&gt;Thanks for this! &amp;nbsp;I did uncover one bug (kind of). &amp;nbsp;When creating copies of files in the project the template doesn't deal with spaces in file names. &amp;nbsp;Also, some of Rob Connery's subsonic mvc templates use a 'ui-lightness' directory under the Scripts folder. &amp;nbsp;Here is my change, it was just a quick hack to get it done :) &amp;nbsp;I've just posted it here for reference, do with it what you wish...&lt;/p&gt;
&lt;p&gt;void ProcessStaticFilesRecursive(ProjectItem projectItem, string path) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;if (IsFolder(projectItem)) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;WriteLine(&amp;quot;[CompilerGenerated]&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string _projectCleanName = projectItem.Name.Replace(&amp;quot; &amp;quot;, &amp;quot;&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_projectCleanName = projectItem.Name.Replace(&amp;quot;-&amp;quot;, &amp;quot;_dash_&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;WriteLine(String.Format(&amp;quot;public static class {0} {{&amp;quot;, _projectCleanName));&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PushIndent(&amp;quot; &amp;nbsp; &amp;nbsp;&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Recurse into all the items in the folder&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;foreach (ProjectItem item in projectItem.ProjectItems) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ProcessStaticFilesRecursive(item, path + &amp;quot;/&amp;quot; + projectItem.Name);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PopIndent();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;WriteLine(&amp;quot;}&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;WriteLine(&amp;quot;&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;else {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;WriteLine(String.Format(&amp;quot;public static string {0} {{ get {{ return VirtualPathUtility.ToAbsolute(\&amp;quot;{1}\&amp;quot;); }} }}&amp;quot;,&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;GetConstantNameFromFileName(projectItem.Name),&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;path + &amp;quot;/&amp;quot; + projectItem.Name));&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9805759</link><pubDate>Fri, 26 Jun 2009 21:12:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9805759</guid><dc:creator>Chad Kranz</dc:creator><description>&lt;p&gt;Ok, there are a few other issues I didn't see before my last post. &amp;nbsp;To replicate, add a file with a space in it (such as Copy of site.css) and a folder with a dash in it (such as Content\ui-lightness). &amp;nbsp;Then re-run the T4 template and you'll see the errors generated. &amp;nbsp;Thanks!&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9805923</link><pubDate>Fri, 26 Jun 2009 23:15:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9805923</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Chad: I fixed that character issue and posted the update on CodePlex (now version 2.0.01)&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9805962</link><pubDate>Fri, 26 Jun 2009 23:58:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9805962</guid><dc:creator>Chad K</dc:creator><description>&lt;p&gt;Thanks Dave! &amp;nbsp;Do you have any suggestions for what Scott H talked about in his blog, looking for the Views.Textbox(), Views.Label and Views.Validation stuff? &amp;nbsp;I am using the latest version of Subsonic 3.0 and love the idea of automatically generating the validation, as well as the label and control options for it but don't want to reinvent the wheel if someone has even a good starting off point.&lt;/p&gt;
&lt;p&gt;Thanks again!&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9805995</link><pubDate>Sat, 27 Jun 2009 00:26:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9805995</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Chad, take a look et Eric Hexter's solution: &lt;a rel="nofollow" target="_new" href="http://www.lostechies.com/blogs/hex/archive/2009/06/09/opinionated-input-builders-for-asp-net-mvc-using-partials-part-i.aspx"&gt;http://www.lostechies.com/blogs/hex/archive/2009/06/09/opinionated-input-builders-for-asp-net-mvc-using-partials-part-i.aspx&lt;/a&gt;. It looks promising, and may be better than a T4 based solution for input builders.&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9806074</link><pubDate>Sat, 27 Jun 2009 02:08:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9806074</guid><dc:creator>daniel</dc:creator><description>&lt;p&gt;Awesome - great work on this so far. &amp;nbsp;I haven't had a chance to play with this latest version, but one thing to watch out for on the content &amp;amp; script links is that the application may not be deployed at the root. &amp;nbsp;For example, &amp;quot;/Scripts/Map.js&amp;quot; will break if you deploy your app to &lt;a rel="nofollow" target="_new" href="http://myserver/somefolder/myapp"&gt;http://myserver/somefolder/myapp&lt;/a&gt;. &amp;nbsp;You may already handle this, but I thought I'd mention...&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9806138</link><pubDate>Sat, 27 Jun 2009 03:34:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9806138</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Daniel, the template does correctly handles non-root sites. I added a paragraph in the post to mention this. Thanks!&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9806560</link><pubDate>Sat, 27 Jun 2009 14:09:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9806560</guid><dc:creator>Adrian Grigore</dc:creator><description>&lt;p&gt;Dave,&lt;/p&gt;
&lt;p&gt;This is great stuff! May I suggest you also add the following method to your T4Extensions class in order to support object htmlAttributes for ActionLink the same way as the standard html helper does:&lt;/p&gt;
&lt;p&gt;public static string ActionLink(this HtmlHelper htmlHelper, string linkText, ActionResult result, object htmlAttributes) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return ActionLink(htmlHelper, linkText, result, new RouteValueDictionary(htmlAttributes));&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9806606</link><pubDate>Sat, 27 Jun 2009 15:50:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9806606</guid><dc:creator>Adrian Grigore</dc:creator><description>&lt;p&gt;One more thing: Strongly typed links usually work great, but in this instance they didn't and I was unable to find out what's going wrong. I tried to replace the following:&lt;/p&gt;
&lt;p&gt;&amp;lt;link rel=&amp;quot;STYLESHEET&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;~/Content/CustDatabase.css&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;with this:&lt;/p&gt;
&lt;p&gt;&amp;lt;link rel=&amp;quot;STYLESHEET&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;&amp;lt;%= Links.Content.CustDatabase_css%&amp;gt;&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;There's no error when compiling the view, but the generated link is strangely messed up:&lt;/p&gt;
&lt;p&gt;&amp;lt;link href=&amp;quot;Views/Shared/%3C%25=%20Links.Content.CustDatabase_css%25%3E&amp;quot; type=&amp;quot;text/css&amp;quot; rel=&amp;quot;STYLESHEET&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;The code generated for the stylesheet in T4MVC.cs is &lt;/p&gt;
&lt;p&gt;public static string CustDatabase_css { get { return VirtualPathUtility.ToAbsolute(&amp;quot;~/Content/CustDatabase.css&amp;quot;); } }&lt;/p&gt;
&lt;p&gt;I am completely clueless why comes up as Views/Shared/%3C%25=%20Links.Content.CustDatabase_css%25%3E in the generated html. Perhaps you have an idea?&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9806613</link><pubDate>Sat, 27 Jun 2009 16:55:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9806613</guid><dc:creator>Adrian Grigore</dc:creator><description>&lt;p&gt;One last question: Is it possible to strong typing in Html.BeginForm?&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9806640</link><pubDate>Sat, 27 Jun 2009 18:18:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9806640</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Adrian:&lt;/p&gt;
&lt;p&gt;- ActionLink: I added the suggested ActionLink overload (now version 2.0.02 on CodePlex)&lt;/p&gt;
&lt;p&gt;- CSS link: I think this happens because code is simply not allowed in this context, so you just can't use a &amp;lt;%= %&amp;gt; here at all. I can't think of a great way around this.&lt;/p&gt;
&lt;p&gt;- BeginForm: in most cases, you don't want this to look like a method call to the Action, because the param values come from the form. But note that you can get some strong typing for the action and controller names by using:&lt;/p&gt;
&lt;p&gt; &amp;nbsp;Html.BeginForm(MVC.Dinners.Actions.Delete, MVC.Dinners.Name)&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9808236</link><pubDate>Mon, 29 Jun 2009 09:12:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9808236</guid><dc:creator>Marco</dc:creator><description>&lt;p&gt;I get the message &amp;quot;The Views folder has a sub-folder named '{0}', but there is no matching controller&amp;quot;. My web project contains the mvc t4 template, but my controllers are stored in a different project. It that not supported?&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9808261</link><pubDate>Mon, 29 Jun 2009 10:25:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9808261</guid><dc:creator>William</dc:creator><description>&lt;p&gt;@Adrian Grigore: I removed the runat=&amp;quot;server&amp;quot; from the head and it then ran perfectly.&lt;/p&gt;
&lt;p&gt;&amp;lt;head &amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;link href=&amp;quot;&amp;lt;%= Links.Shared.CSS.Website_Default_css %&amp;gt;&amp;quot; rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/head&amp;gt;&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9808578</link><pubDate>Mon, 29 Jun 2009 16:14:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9808578</guid><dc:creator>Richard</dc:creator><description>&lt;p&gt;This is an excellent template! One question, though - is there a reason the s_actions, s_views, and the public fields of the _Actions and _Views classes are not read-only?&lt;/p&gt;
&lt;p&gt;For the CSS link, you'll need to use something like Dave Reed's CodeExpressionBuilder:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://weblogs.asp.net/infinitiesloop/archive/2006/08/09/The-CodeExpressionBuilder.aspx"&gt;http://weblogs.asp.net/infinitiesloop/archive/2006/08/09/The-CodeExpressionBuilder.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href='&amp;lt;%$ Code: Links.Content.CustDatabase_css %&amp;gt;' /&amp;gt;&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9809053</link><pubDate>Tue, 30 Jun 2009 03:22:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9809053</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;New build 2.1.00 is now on CodePlex.&lt;/p&gt;
&lt;p&gt;- New BeginForm helpers (thanks Michael Hart and Adrian)&lt;/p&gt;
&lt;p&gt;- Various strings changed to readonly, as suggested by Richard&lt;/p&gt;
&lt;p&gt;- Misc fixes (see history in .tt file for details)&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9809057</link><pubDate>Tue, 30 Jun 2009 03:27:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9809057</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Marco: indeed, that's not currently supported. I think it could work by:&lt;/p&gt;
&lt;p&gt;- Putting the .tt in your controllers project, not the web project&lt;/p&gt;
&lt;p&gt;- Changing the .tt logic to find the views in the web project&lt;/p&gt;
&lt;p&gt;If someone gets to try this and has success, please send me your updates. &amp;nbsp;Thanks! :)&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9809082</link><pubDate>Tue, 30 Jun 2009 04:34:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9809082</guid><dc:creator>Graham</dc:creator><description>&lt;p&gt;Hey Dave, great template!&lt;/p&gt;
&lt;p&gt;How do you see this fitting in with MVC Futures? I sense planets will collide very soon... I personally enjoy the approach you have given us, perhaps over some of the &amp;quot;Future&amp;quot; constructs... As Hanselman said, would be nice for this to be put through QA and baked in =)&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9809084</link><pubDate>Tue, 30 Jun 2009 04:42:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9809084</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Graham: I think this and the Futures can live together, though they do intersect in some aspects. One thing the Futures can't do is the View name and static file support, because that's based on physical file existence and not code constructs. On the other hand, the Futures have some View render helpers (e.g. TextBoxFor) which I'm not sure we can easily &amp;nbsp;match with the T4 approach.&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9809185</link><pubDate>Tue, 30 Jun 2009 06:40:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9809185</guid><dc:creator>Anthony</dc:creator><description>&lt;p&gt;Just thought that I would let you know I have started using this and with great success. Not sure if you mentioned it or not but another place you can reference the generated code is when registering routs, i.e. &lt;/p&gt;
&lt;p&gt;this._Routes.MapRoute(&amp;quot;Default&amp;quot;, &amp;quot;{controller}/{action}&amp;quot;, new { controller = MVC.Home.Name, action = MVC.Home.Actions.Index });&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9809549</link><pubDate>Tue, 30 Jun 2009 14:48:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9809549</guid><dc:creator>Marco</dc:creator><description>&lt;p&gt;&amp;gt;&amp;gt;-Putting the .tt in your controllers project, not the web project&lt;/p&gt;
&lt;p&gt;No, does not work...&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;gt;- Changing the .tt logic to find the views in the web project&lt;/p&gt;
&lt;p&gt;I think the controllers should be loaded from all the projects in the current solution.Anyone tried to change the logic?&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9809570</link><pubDate>Tue, 30 Jun 2009 15:16:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9809570</guid><dc:creator>Richard Kimber</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;If your Content folder is empty, you get a build error.&lt;/p&gt;
&lt;p&gt;ProcessStaticFiles writes out this line without wrapping in a class.&lt;/p&gt;
&lt;p&gt;public static readonly string Content = Url(&amp;quot;Content&amp;quot;);&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9809659</link><pubDate>Tue, 30 Jun 2009 16:51:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9809659</guid><dc:creator>Christian</dc:creator><description>&lt;p&gt;The current implementation doesn't work well with Dependency Injection! &lt;/p&gt;
&lt;p&gt;You automatically generate a default constructor and one with your dummy parameter. &lt;/p&gt;
&lt;p&gt;StructureMap for example now calls the wrong constructor.&lt;/p&gt;
&lt;p&gt;Any ideas on how to work around this without explicitly decorating the real constructor with an DI-specific attribute?&lt;/p&gt;
&lt;p&gt;despite this issue, i really like this approach.&lt;/p&gt;
&lt;p&gt;best regards, christian&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9809906</link><pubDate>Tue, 30 Jun 2009 21:35:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9809906</guid><dc:creator>Jim</dc:creator><description>&lt;p&gt;I have controllers that inherit from a base controller, and the code generated in t4mvc.cs &amp;nbsp;produces 'warnings' at build time. &amp;nbsp;i.e.&lt;/p&gt;
&lt;p&gt;&amp;quot;...Controllers.MyController.RedirectToAction() hides inherited member '...Controllers.MyBaseController.RedirectToAction(). &amp;nbsp;Use the new keyword if hiding was intended.&amp;quot;&lt;/p&gt;
&lt;p&gt;I'm not really sure if this is a problem, other than making me wade through warnings to find any I'm really interested in, but I thought I'd pass it along. &amp;nbsp;Mostly likely I'm just doing something wrong.&lt;/p&gt;
&lt;p&gt;Thanks ... jim&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9809943</link><pubDate>Tue, 30 Jun 2009 22:17:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9809943</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;New version 2.2.00 is up on CodePlex&lt;/p&gt;
&lt;p&gt;Richard Kimber: fixed the issue with empty Content folder. Good catch!&lt;/p&gt;
&lt;p&gt;Christian: made a change which *should* fix your issue with Dependency Injection. If it doesn't please email me and we'll take it offline.&lt;/p&gt;
&lt;p&gt;Jim: Fixed issue with Controller base class. For the fix to work, please make sure you make your base Controller abstract. Thanks!&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9809948</link><pubDate>Tue, 30 Jun 2009 22:21:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9809948</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Marco: I didn't mean that just putting the .tt in teh Controllers project was enough. It's only a piece of a solution which also involves changing the .tt logic. Hopefully, I can look at that at some point, though if someone else gets to it first, all the better! :)&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9809952</link><pubDate>Tue, 30 Jun 2009 22:25:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9809952</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Anthony: indeed, this is a great use of it in the routes, I hadn't thought of it. &amp;nbsp;I actually just added some better support for this in 2.2. Now you can write:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;routes.MapRoute(&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;Default&amp;quot;,&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;{controller}/{action}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MVC.Home.Index()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;);&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9810169</link><pubDate>Wed, 01 Jul 2009 03:00:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9810169</guid><dc:creator>Harry M</dc:creator><description>&lt;p&gt;Am I right in thinking this could be used to generate static reflection helper classes with things like property names and attributes? I'm going to have a play with the template ASAP!&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9810766</link><pubDate>Wed, 01 Jul 2009 14:10:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9810766</guid><dc:creator>Alex M</dc:creator><description>&lt;p&gt;I've encountered several bugs in 2.2.00:&lt;/p&gt;
&lt;p&gt;BUG 1:&lt;/p&gt;
&lt;p&gt;If any controller is already declared partial then there will be an entry in the Controllers list for each constituent file. This triggers am exception on template execution on line 478, because the call to 'SingleOrDefault' will return multiple results.&lt;/p&gt;
&lt;p&gt;FIX:&lt;/p&gt;
&lt;p&gt;Change the type of the 'Controllers' list to 'HashSet&amp;lt;ControllerInfo&amp;gt;' for an implicit 'distinct', slap an IEquatable&amp;lt;ControllerInfo&amp;gt;' interface in there and modify the ProcessControllerTypesInNamespace method slightly:&lt;/p&gt;
&lt;p&gt;line 287:&lt;/p&gt;
&lt;p&gt;static List&amp;lt;ControllerInfo&amp;gt; Controllers; &lt;/p&gt;
&lt;p&gt;=&amp;gt; &lt;/p&gt;
&lt;p&gt;static HashSet&amp;lt;ControllerInfo&amp;gt; Controllers;&lt;/p&gt;
&lt;p&gt;line 295:&lt;/p&gt;
&lt;p&gt;Controllers = new List&amp;lt;ControllerInfo&amp;gt;();&lt;/p&gt;
&lt;p&gt;=&amp;gt;&lt;/p&gt;
&lt;p&gt;Controllers = new HashSet&amp;lt;ControllerInfo&amp;gt;();&lt;/p&gt;
&lt;p&gt;Expanded ControllerInfo definition:&lt;/p&gt;
&lt;p&gt;class ControllerInfo : IEquatable&amp;lt;ControllerInfo&amp;gt; {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;...&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;public bool Equals(ControllerInfo obj) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return obj != null &amp;amp;&amp;amp; FullClassName == obj.FullClassName;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;public override int GetHashCode() {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return FullClassName.GetHashCode();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;} &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;Modification to 'ProcessControllerTypesInNamespace' method:&lt;/p&gt;
&lt;p&gt;-----&lt;/p&gt;
&lt;p&gt;Controllers.Add(controllerInfo);&lt;/p&gt;
&lt;p&gt;controllerInfo.HasExplicitConstructor = HasExplicitConstructor(type);&lt;/p&gt;
&lt;p&gt;// Process all the action methods in the controller&lt;/p&gt;
&lt;p&gt;ProcessControllerActionMethods(controllerInfo, type);&lt;/p&gt;
&lt;p&gt;-----&lt;/p&gt;
&lt;p&gt;=&amp;gt; &lt;/p&gt;
&lt;p&gt;-----&lt;/p&gt;
&lt;p&gt;// either process new controllerinfo or integrate results into existing object for partially defined controllers&lt;/p&gt;
&lt;p&gt;var target = Controllers.Add(controllerInfo) ? controllerInfo : Controllers.First(c =&amp;gt; c.Equals(controllerInfo)); &lt;/p&gt;
&lt;p&gt;target.HasExplicitConstructor |= HasExplicitConstructor(type);&lt;/p&gt;
&lt;p&gt;// Process all the action methods in the controller&lt;/p&gt;
&lt;p&gt;ProcessControllerActionMethods(target, type);&lt;/p&gt;
&lt;p&gt;-----&lt;/p&gt;
&lt;p&gt;BUG 2:&lt;/p&gt;
&lt;p&gt;The static file access generation (and possibly other) code yields incorrect paths on (T4 or designer) generated files:&lt;/p&gt;
&lt;p&gt;Imagine an 'Output.tt' file in Project/Content that in turn generates some files called 'foo.css' &amp;amp; 'bar.css'.&lt;/p&gt;
&lt;p&gt;The solution explorer will show these files as&lt;/p&gt;
&lt;p&gt;Project&lt;/p&gt;
&lt;p&gt;+- Content&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;+- Output.tt&lt;/p&gt;
&lt;p&gt;	 &amp;nbsp; &amp;nbsp;+- foo.css&lt;/p&gt;
&lt;p&gt;		+- bar.css&lt;/p&gt;
&lt;p&gt;The physical path for 'foo.css' is 'Project/Content/foo.css', but the T4MVC template generates a path of '~/Project/Content/Output.tt/foo.css' which is clearly wrong :(&lt;/p&gt;
&lt;p&gt;FIX:&lt;/p&gt;
&lt;p&gt;Don't rely on the IsFolder method. In it's current implementation the results have more of a 'HasChildren' meaning. &lt;/p&gt;
&lt;p&gt;Instead use ProjectItem.Kind (&lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/en-us/library/z4bcch80%28VS.80%29.aspx"&gt;http://msdn.microsoft.com/en-us/library/z4bcch80%28VS.80%29.aspx&lt;/a&gt;) to check if the item with children is actually a physical folder and only then construct an inner class with modified path.&lt;/p&gt;
&lt;p&gt;Since IsFolder is used in several places, I didn't touch it but instead refactored the ProcessStaticFilesRecursive method:&lt;/p&gt;
&lt;p&gt;----&lt;/p&gt;
&lt;p&gt;void ProcessStaticFilesRecursive(ProjectItem projectItem, string path) {&lt;/p&gt;
&lt;p&gt;	bool isPhysicalFolder = projectItem.Kind == &amp;quot;{6BB5F8EF-4483-11D3-8BCF-00C04F8EC28C}&amp;quot;;	// see ProjectItem.Kind documentation on msdn&lt;/p&gt;
&lt;p&gt;	if (isPhysicalFolder) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; 		WriteLine(&amp;quot;[CompilerGenerated]&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; 		WriteLine(String.Format(&amp;quot;public static class {0} {{&amp;quot;, SanitizeFileName(projectItem.Name)));&lt;/p&gt;
&lt;p&gt; &amp;nbsp; 		PushIndent(&amp;quot; &amp;nbsp; &amp;nbsp;&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; 		WriteLine(String.Format(&amp;quot;public static string Url() {{ return VirtualPathUtility.ToAbsolute(\&amp;quot;{0}\&amp;quot;); }}&amp;quot;, path + &amp;quot;/&amp;quot; + projectItem.Name));&lt;/p&gt;
&lt;p&gt; &amp;nbsp; 		WriteLine(String.Format(&amp;quot;public static string Url(string fileName) {{ return VirtualPathUtility.ToAbsolute(\&amp;quot;{0}/\&amp;quot; + fileName); }}&amp;quot;, path + &amp;quot;/&amp;quot; + projectItem.Name));&lt;/p&gt;
&lt;p&gt;		// Recurse into all the items in the folder&lt;/p&gt;
&lt;p&gt;		foreach (ProjectItem item in projectItem.ProjectItems) {&lt;/p&gt;
&lt;p&gt;			ProcessStaticFilesRecursive(item, path + &amp;quot;/&amp;quot; + projectItem.Name);&lt;/p&gt;
&lt;p&gt;		}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; 		PopIndent();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; 		WriteLine(&amp;quot;}&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; 		WriteLine(&amp;quot;&amp;quot;);	 &amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;	} else {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; 		WriteLine(String.Format(&amp;quot;public static readonly string {0} = Url(\&amp;quot;{1}\&amp;quot;);&amp;quot;,&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; 		SanitizeFileName(projectItem.Name),&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; 		projectItem.Name));&lt;/p&gt;
&lt;p&gt;		// non folder items may also have children (virtual folders, Class.cs -&amp;gt; Class.Designer.cs, template output) - just register them on the same path as their parent item&lt;/p&gt;
&lt;p&gt;		foreach (ProjectItem item in projectItem.ProjectItems) {&lt;/p&gt;
&lt;p&gt;			ProcessStaticFilesRecursive(item, path );&lt;/p&gt;
&lt;p&gt;		}&lt;/p&gt;
&lt;p&gt;	}		&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;----&lt;/p&gt;
&lt;p&gt;I'm pretty sure there is an equivalent bug for views and controllers (which could theoretically also be auto-generated and thus appear as child nodes to non folders), but I'll leave that fix to somebody else ;)&lt;/p&gt;
&lt;p&gt;BUG 3:&lt;/p&gt;
&lt;p&gt;If a controller is derived from a base class that already implements some action methods, those methods are never discovered:&lt;/p&gt;
&lt;p&gt;abstract class FooBaseController : Controller {&lt;/p&gt;
&lt;p&gt; &amp;nbsp;ActionResult SkippedMethod(...);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;class FooController : FooBaseController {&lt;/p&gt;
&lt;p&gt; &amp;nbsp;ActionResult FoundMethod(...);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;There is no code generated for 'SkippedMethod'.&lt;/p&gt;
&lt;p&gt;FIX: &lt;/p&gt;
&lt;p&gt;Haven't looked into this one yet&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9811182</link><pubDate>Wed, 01 Jul 2009 17:43:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9811182</guid><dc:creator>Pat</dc:creator><description>&lt;p&gt;Nice! I updated and it broke everything.&lt;/p&gt;
&lt;p&gt;Why the new requirement to only support ActionResult return types? My actions return strongly types like ViewResult, etc.&lt;/p&gt;
&lt;p&gt;Why can't it keep track of what the action method return type is and carry that over into the helpers?&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9811224</link><pubDate>Wed, 01 Jul 2009 18:04:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9811224</guid><dc:creator>Hien Khieu</dc:creator><description>&lt;p&gt;David,&lt;/p&gt;
&lt;p&gt;I am trying to use your latest T4MVC template with my mvc project and I get this error. Please help.&lt;/p&gt;
&lt;p&gt;Error	1	Running transformation: System.EntryPointNotFoundException: Entry point was not found.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at VisualSVN.VS.Interop.NativeExtenderCallback.OnQueryEditFiles(UInt32 rgfQueryEdit, String[] rgpszMkDocuments, UInt32* pfEditVerdict, UInt32* prgfMoreInfo, Boolean* skipOriginal)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at VisualSVN.VS.Interop.NativeExtender.OnQueryEditFiles(NativeExtender* , UInt32 rgfQueryEdit, Int32 cFiles, UInt16** rgpszMkDocuments, UInt32* rgrgf, __MIDL___MIDL_itf_ivsqueryeditquerysave2_0000_0001* rgFileInfo, UInt32* pfEditVerdict, UInt32* prgfMoreInfo, Boolean* skipOriginal)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at EnvDTE80.CodeClass2.set_ClassKind(vsCMClassKind Kind)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at Microsoft.VisualStudio.TextTemplating984425EEA278851503849A871981DA21.GeneratedTextTransformation.ProcessControllerTypesInNamespace(CodeNamespace ns) in e:\Development\CSharp\MVC\MVCExperiment\MVCExperiment\Mvc-CodeGen.tt:line 401&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at Microsoft.VisualStudio.TextTemplating984425EEA278851503849A871981DA21.GeneratedTextTransformation.ProcessControllersRecursive(ProjectItem projectItem) in e:\Development\CSharp\MVC\MVCExperiment\MVCExperiment\Mvc-CodeGen.tt:line 381&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at Microsoft.VisualStudio.TextTemplating984425EEA278851503849A871981DA21.GeneratedTextTransformation.ProcessControllersRecursive(ProjectItem projectItem) in e:\Development\CSharp\MVC\MVCExperiment\MVCExperiment\Mvc-CodeGen.tt:line 374&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at Microsoft.VisualStudio.TextTemplating984425EEA278851503849A871981DA21.GeneratedTextTransformation.ProcessControllersFolder(Project project) in e:\Development\CSharp\MVC\MVCExperiment\MVCExperiment\Mvc-CodeGen.tt:line 366&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at Microsoft.VisualStudio.TextTemplating984425EEA278851503849A871981DA21.GeneratedTextTransformation.PrepareDataToRender(TextTransformation tt) in e:\Development\CSharp\MVC\MVCExperiment\MVCExperiment\Mvc-CodeGen.tt:line 306&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at Microsoft.VisualStudio.TextTemplating984425EEA278851503849A871981DA21.GeneratedTextTransformation.TransformText() in e:\Development\CSharp\MVC\MVCExperiment\MVCExperiment\Mvc-CodeGen.tt:line 96	E:\Development\CSharp\MVC\MVCExperiment\MVCExperiment\Mvc-CodeGen.tt	1	1	&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9811290</link><pubDate>Wed, 01 Jul 2009 18:41:49 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9811290</guid><dc:creator>Pat</dc:creator><description>&lt;p&gt;So I was able to improve it to add support for other Action return types. Not easy. Sometimes these &amp;quot;helpers&amp;quot; take on a life of their own. Basically in the get action methods routine I parsed out the return type name and stored it in the ActionMethodInfo class. Then I turned ControllerActionCallInfo into an interface and added new classes like ControllerActionResultCallInfo, ControllerViewResultCallInfo, etc that implemented that interface and fixed up various other parts to reference the interface and return the correct type instead of the hardcoded ActionResult and everything is working again!&lt;/p&gt;
&lt;p&gt;Great stuff....&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9812097</link><pubDate>Thu, 02 Jul 2009 01:16:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9812097</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Alex M: thanks a lot for working through those issues! &amp;nbsp;New build 2.2.01 on CodePlex has the fixes for issues 1 and 2. I mostly used your code, with minor changes. I actually fixed the issue you bring up for controllers as well.&lt;/p&gt;
&lt;p&gt;BTW, they have constants for all the GUIDs, so you can write Constants.vsProjectItemKindPhysicalFolder. I know, not very discoverable, but once you know where they are, they're all there!&lt;/p&gt;
&lt;p&gt;Bug #3: definitely a bug, but I haven't had a chance to look into it. &amp;nbsp;Anyone? :)&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9812103</link><pubDate>Thu, 02 Jul 2009 01:19:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9812103</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Hien Khieu: strange, I don't know what could cause that. Is this with VS2008 SP1? I'll ask the Visual Studio team if they can make sense of the stack. It's dying when the code tries to change the class to be partial.&lt;/p&gt;
&lt;p&gt;Maybe you can work around by making it partial yourself.&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9812117</link><pubDate>Thu, 02 Jul 2009 01:22:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9812117</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Pat: I went ahead and fixed this in 2.2.01 (now on CodePlex). My fix is similar to what you described. One difference is that I made it generic, by auto-generating derived classes for all the Result types it encounters, instead of hard coding a few (or maybe that's what you did too?).&lt;/p&gt;
&lt;p&gt;Anyway, please make sure it works for you. &amp;nbsp;BTW, feel free to email me your changes next time, to give me a starting point for the fix :)&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9812292</link><pubDate>Thu, 02 Jul 2009 02:52:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9812292</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Hien Khieu: it would appear that your issue is related to running VisualSVN. Please see this thread where a similar thing was reported:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://l2st4.codeplex.com/Thread/View.aspx?ThreadId=44898"&gt;http://l2st4.codeplex.com/Thread/View.aspx?ThreadId=44898&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9812730</link><pubDate>Thu, 02 Jul 2009 06:17:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9812730</guid><dc:creator>Hien Khieu</dc:creator><description>&lt;p&gt;David,&lt;/p&gt;
&lt;p&gt;Thank you for looking into my issue. VisualSVN is what I am thinking when I read the stack trace. One think I don't understand that I was able to use your old MVC T4 template (the one that I download sometimes last week) with no problem. Thank you anyway.&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9813620</link><pubDate>Thu, 02 Jul 2009 12:38:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9813620</guid><dc:creator>parminder</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;thanks for this great work. I wana bring&lt;/p&gt;
&lt;p&gt;one issue in your attention. I have a controller method&lt;/p&gt;
&lt;p&gt;public &amp;nbsp;FileContentResult GetSmallImage(long photoID)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Return somefile;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;It makes the method as virtual(no prblem).&lt;/p&gt;
&lt;p&gt;It doesnt compile and says Error	'System.Web.Mvc.FileContentResult' does not contain a constructor that takes '0' arguments	&lt;/p&gt;
&lt;p&gt;This is line where the error lies.&lt;/p&gt;
&lt;p&gt;public T4MVC_FileContentResult(string controller, string action) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;this.InitMVCT4Result(controller, action);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;It seems it didnt created controller method name properly.&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9814807</link><pubDate>Thu, 02 Jul 2009 22:24:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9814807</guid><dc:creator>Alex M.</dc:creator><description>&lt;p&gt;Well David, I took another look at my Bug #3 and came up with a partial solution - which of course in turned lead to another problem. &lt;/p&gt;
&lt;p&gt;Since I don't know the EnvDTE classes well enough to tell if my new problem is simple or easy to workaround, I'll just throw in what I got this far:&lt;/p&gt;
&lt;p&gt;Modify 'ProcessControllerActionMethods' to:&lt;/p&gt;
&lt;p&gt;void ProcessControllerActionMethods(ControllerInfo controllerInfo, CodeClass2 current) {&lt;/p&gt;
&lt;p&gt;	// walk up the controller inheritance chain until we arrive at the mvc default controller&lt;/p&gt;
&lt;p&gt;	for (CodeClass2 type = current; current != null &amp;amp;&amp;amp; current.FullName != &amp;quot;System.Web.Mvc.Controller&amp;quot;; current = current.Bases.Item(1) as CodeClass2) {&lt;/p&gt;
&lt;p&gt;		foreach (CodeFunction2 method in GetMethods(type)) {&lt;/p&gt;
&lt;p&gt;			...&lt;/p&gt;
&lt;p&gt;			// keep existing unmodified code here (skipped for brevity)&lt;/p&gt;
&lt;p&gt;			...&lt;/p&gt;
&lt;p&gt;			// Make sure the method is virtual&lt;/p&gt;
&lt;p&gt;			if (!method.CanOverride) {&lt;/p&gt;
&lt;p&gt;				method.CanOverride = true;		// *** THIS NEEDS SOME MORE CHECKS, SEE REMARKS&lt;/p&gt;
&lt;p&gt;				Warning(String.Format(&amp;quot;{0} changed the action method {1}.{2} to be virtual&amp;quot;, T4FileName, type.Name, method.Name));&lt;/p&gt;
&lt;p&gt;			}&lt;/p&gt;
&lt;p&gt;			...&lt;/p&gt;
&lt;p&gt;			//	more code that needs no change&lt;/p&gt;
&lt;p&gt;			...&lt;/p&gt;
&lt;p&gt;		}&lt;/p&gt;
&lt;p&gt;	}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;Explanation:&lt;/p&gt;
&lt;p&gt;The modified code simply walks up the inheritance chain and looks at all the intermediate types' methods until it stops at the stock mvc Controller base class. Choosing Bases.Item(1) shouldn't cause any problem since no .NET language actually supports multiple inheritance.&lt;/p&gt;
&lt;p&gt;Now there are some potential problems with the 'method.CanOverride = true' call:&lt;/p&gt;
&lt;p&gt;A) The current controller code class 'type' is part of the same project as the template&lt;/p&gt;
&lt;p&gt; =&amp;gt; everything should be okay, but might still fail for external reasons (source code control lock on the code file). The current implementation fails on those errors anyway - with a try/catch block you could just skip those elements, emit a warning and 'continue' with the next method.&lt;/p&gt;
&lt;p&gt;B) The current controller code class 'type' is defined in an external source, either referenced project or assembly:&lt;/p&gt;
&lt;p&gt; 1) The code class 'type' is defined in another project which is part of the same solution as the template&lt;/p&gt;
&lt;p&gt; &amp;nbsp; =&amp;gt; switching the method to virtual should succeed (same caveats as in #A apply), but on my machine this always failed (the stacktrace contained some code from jetbrain's resharper, so that component might be to blame for it).&lt;/p&gt;
&lt;p&gt; 2) The code class 'type' is defined in a referenced assembly.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; =&amp;gt; making the method virtual will always fail&lt;/p&gt;
&lt;p&gt;So as I see it, there needs to be a check (and try/catch block) around the 'make virtual' functionality for cases A &amp;amp; B.1 to work correctly.&lt;/p&gt;
&lt;p&gt;For B.1 it might also be necessary to walk the solution and find the actual code class from the base classes' definition to change properties, since code classes with an 'external' storage are generated from metadata and that might have been why the 'CanOverrid=true' failed - There's already very similar code in the template to find the actual ProjectItem for the template file.&lt;/p&gt;
&lt;p&gt;I cannot see any way to fix B.2, the best way here would probably just be to skip those methods with a warning, or at least process them with reduced output (and functionality) that doesn't need virtual methods (you could still expose the action names).&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9814987</link><pubDate>Thu, 02 Jul 2009 23:45:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9814987</guid><dc:creator>Alex M.</dc:creator><description>&lt;p&gt;Just noticed that I made a mistake in that demo code (wrote if from memory, since I removed those template changes). That new outer for loop should be:&lt;/p&gt;
&lt;p&gt;for (CodeClass2 type = current; type != null &amp;amp;&amp;amp; type.FullName != &amp;quot;System.Web.Mvc.Controller&amp;quot;; type = type.Bases.Item(1) as CodeClass2) {&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9815022</link><pubDate>Fri, 03 Jul 2009 00:04:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9815022</guid><dc:creator>Bob Baker</dc:creator><description>&lt;p&gt;I have the same problem as Hien with VisualSVN. The thread &lt;a rel="nofollow" target="_new" href="http://l2st4.codeplex.com/Thread/View.aspx?ThreadId=44898"&gt;http://l2st4.codeplex.com/Thread/View.aspx?ThreadId=44898&lt;/a&gt; has a reply where there seems to be a workaround. Can you implement that in your t4 template? Thanks&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9815024</link><pubDate>Fri, 03 Jul 2009 00:05:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9815024</guid><dc:creator>Bob Baker</dc:creator><description>&lt;p&gt;Follow up with VisualSVN...&lt;/p&gt;
&lt;p&gt;Guidance from the VisualSVN team:&lt;/p&gt;
&lt;p&gt;&amp;quot;It turns out that problem is caused by ActiveWriter using DTE from temporary AppDomain. To fix this all calls to DTE should be marshaled to default AppDomain. As a simple workaround you can do code generation on separate working thread.&amp;quot;&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9816407</link><pubDate>Fri, 03 Jul 2009 11:28:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9816407</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;parminder: just fixed this issue in build 2.2.02 on CodePlex&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9816411</link><pubDate>Fri, 03 Jul 2009 11:29:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9816411</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Alex M: thanks for looking into this. I haven't had a chance to look into your code yet, but I plan to early next week!&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9816417</link><pubDate>Fri, 03 Jul 2009 11:33:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9816417</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Bob (and Hien): VisualSVN issue: I'm not very sure how I could do this from a T4 file. The T4 file is executed by VS in a different AppDomain, and I don't think this can be changed. If someone understands the issue better and has a fix, please let me know.&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9821145</link><pubDate>Tue, 07 Jul 2009 04:42:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9821145</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Alex M: I have integrated your fix to deal with base class action methods. I also added exception handling on the code that tries to make methods virtual (and make controllers partial). When that happens, it skips the method and gives a warning suggesting that the user makes that change themselves if possible. Obviously, when dealing with a true binary you don't control, it won't be possible, but I think that's an edge case. Thanks again!&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9821149</link><pubDate>Tue, 07 Jul 2009 04:44:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9821149</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Alex M: forgot to mention that the new build is 2.2.03 on CodePlex.&lt;/p&gt;
&lt;p&gt;Bob (and Hien): VisualSVN issue: 2.2.03 deals with those errors more gracefully. The workaround for you is to make the methods partial yourself (see previous comment).&lt;/p&gt;
</description></item><item><title>It supports controllers that are in sub-folders of the Controllers folder and not directly in there</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9822071</link><pubDate>Tue, 07 Jul 2009 12:34:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9822071</guid><dc:creator>Ramandeep Singh</dc:creator><description>&lt;p&gt;I am using T4MVC.tt in my project. I am facing the problem that I have sub folders in the controllers folder.&lt;/p&gt;
&lt;p&gt;e.g. (Controllers\Member\Account\ActivationController.cs)&lt;/p&gt;
&lt;p&gt;There is no compile time error. But when I run the project it creates the object of those Controllers which are on the root of &amp;quot;Controllers folder&amp;quot; e.g &amp;quot;Home&amp;quot; = T4MVC.T4MVC_HomeController&lt;/p&gt;
&lt;p&gt;but Activation(ActivationControllers) is null&lt;/p&gt;
&lt;p&gt;And also all other controllers are null because they all are in the sub folders.&lt;/p&gt;
</description></item><item><title>It supports controllers that are in sub-folders</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9822127</link><pubDate>Tue, 07 Jul 2009 12:55:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9822127</guid><dc:creator>Ramandeep Singh</dc:creator><description>&lt;p&gt;Please tell me the way out as I have more then 200 controllers and I want to keep them in sub folders.&lt;/p&gt;
&lt;p&gt;Thanks in advance&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9822708</link><pubDate>Tue, 07 Jul 2009 17:58:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9822708</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Ramandeep: T4MVC is supposed to support controllers that are in sub folders of the Controllers folder. Please see the code in ProcessControllersRecursive. Not sure why it wouldn't work for you. Please look through the tt file and the generated file to try to figure out what's going on. Make sure you use the latest version (2.2.03).&lt;/p&gt;
&lt;p&gt;Or if you can put together a small repro, you can email it to me and I'll take a look.&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9823079</link><pubDate>Tue, 07 Jul 2009 22:30:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9823079</guid><dc:creator>Alex M.</dc:creator><description>&lt;p&gt;Nice changes there david - I've got some more bugs &amp;amp; fixes ;)&lt;/p&gt;
&lt;p&gt;1)&lt;/p&gt;
&lt;p&gt;The controller inheritance chain analysis works great now. But it still fails the 'CanOverride=true' call on base types from external project. &lt;/p&gt;
&lt;p&gt;If you insert the following code in 'ProcessControllerActionMethods' before the 'foreach (CodeFunction2 method ...' loop you'll get a better refactoring experience:&lt;/p&gt;
&lt;p&gt;----&lt;/p&gt;
&lt;p&gt;// if the type is defined in another project, try getting a direct reference which might give more access for modifications&lt;/p&gt;
&lt;p&gt;if (type.InfoLocation != vsCMInfoLocation.vsCMInfoLocationProject) {&lt;/p&gt;
&lt;p&gt;	var dte = type.DTE;&lt;/p&gt;
&lt;p&gt;	foreach (Project prj in dte.Solution.Projects) {&lt;/p&gt;
&lt;p&gt;		if (prj != Project &amp;amp;&amp;amp; prj.CodeModel != null) {&lt;/p&gt;
&lt;p&gt;			var prjCodeType = prj.CodeModel.CodeTypeFromFullName(type.FullName);	&lt;/p&gt;
&lt;p&gt;			if (prjCodeType != null &amp;amp;&amp;amp; prjCodeType.InfoLocation == vsCMInfoLocation.vsCMInfoLocationProject) {&lt;/p&gt;
&lt;p&gt;				type = (CodeClass2) prjCodeType;&lt;/p&gt;
&lt;p&gt;				break;&lt;/p&gt;
&lt;p&gt;			}											&lt;/p&gt;
&lt;p&gt;		}										&lt;/p&gt;
&lt;p&gt;	}				 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;----&lt;/p&gt;
&lt;p&gt;With this modification I could successfully refactor any base class method from *non-generic* controllers. Generic base controllers still don't work, but since the exception is as specific as 'unexpected error (hresult 0x8004005)' I don't have much hope for those.&lt;/p&gt;
&lt;p&gt;2)&lt;/p&gt;
&lt;p&gt;I completed the '// TODO: Make the base type check more reliable' task inside 'ProcessControllerActionMethods':&lt;/p&gt;
&lt;p&gt;----&lt;/p&gt;
&lt;p&gt;// We only support action methods that return an ActionResult derived type&lt;/p&gt;
&lt;p&gt;if (!method.Type.CodeType.get_IsDerivedFrom(&amp;quot;System.Web.Mvc.ActionResult&amp;quot;)) &lt;/p&gt;
&lt;p&gt;	continue;&lt;/p&gt;
&lt;p&gt;----&lt;/p&gt;
&lt;p&gt;3)&lt;/p&gt;
&lt;p&gt;Thanks to the finally working base class methods I found a bug in one of our usage scenarios. For the following definition:&lt;/p&gt;
&lt;p&gt;public class FooBarController {&lt;/p&gt;
&lt;p&gt;	[ActionName(&amp;quot;Bar&amp;quot;)]&lt;/p&gt;
&lt;p&gt;	public ActionResult Foo() {&lt;/p&gt;
&lt;p&gt;		...&lt;/p&gt;
&lt;p&gt;	}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;the template will output code like&lt;/p&gt;
&lt;p&gt;public partial class FooBarController {&lt;/p&gt;
&lt;p&gt;	public class _Actions {&lt;/p&gt;
&lt;p&gt;		public readonly string Foo = &amp;quot;Foo&amp;quot;;&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;which is wrong, since the action (and the url where it can be invoked) is actually 'FooBar/Bar', not 'FooBar/Foo'.&lt;/p&gt;
&lt;p&gt;You'll probably have to check each controller action method for attributes deriving from System.Web.Mvc.ActionNameSelectorAttribute, but I'd argue it should be enough to only check for the derived 'ActionName' attribute.&lt;/p&gt;
&lt;p&gt;Though anybody could easily define their own ActionNameSelectorAttribute derived implementation (imagine an attribute that accepts every action which contains the letter 'a' at least three times), there might be no clearly defined reverse lookup from the attribute instance to the action name, and even if there is one, the template could never know it.&lt;/p&gt;
&lt;p&gt;'ActionName' does both ship with the MVC Framework and has a clearly defined value-to-action relationship, so this would always work.&lt;/p&gt;
&lt;p&gt;If you intend to implement this functionality, be sure to also add the code from #1, since the 'Attributes' collection is always empty for code with an InfoLocation other than vsCMInfoLocationProject, so you need the direct type references to the defining project here.&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9823128</link><pubDate>Tue, 07 Jul 2009 23:43:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9823128</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Alex M: would you mind contacting me be email (david.ebbo [@ microsoft.com]). It'll be easier to continue discussing this. &amp;nbsp;Thanks!&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9823362</link><pubDate>Wed, 08 Jul 2009 04:53:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9823362</guid><dc:creator>davidebb</dc:creator><description>&lt;p&gt;Alex M: please check out v2.3 on CodePlex.&lt;/p&gt;
</description></item><item><title>re: The MVC T4 template is now up on CodePlex, and it does change your code a bit</title><link>http://blogs.msdn.com/davidebb/archive/2009/06/26/the-mvc-t4-template-is-now-up-on-codeplex-and-it-does-change-your-code-a-bit.aspx#9833408</link><pubDate>Tue, 14 Jul 2009 22:04:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9833408</guid><dc:creator>Pat</dc:creator><description>&lt;p&gt;Thanks! I tried the latest version in place of my custom fixed version and everything still works! I had hardcoded classes for the return types so your fix is definitely better. Thanks again! Nice to know I'm back in sync with the latest online version.&lt;/p&gt;
</description></item></channel></rss>