t4mvc Wiki Rss Feedhttps://t4mvc.codeplex.com/t4mvc Wiki Rss DescriptionUpdated Wiki: Homehttps://t4mvc.codeplex.com/wikipage?version=14<div class="wikidoc">
<h1 style="color:red">T4MVC has moved to <a href="https://github.com/T4MVC/T4MVC">
GitHub</a>.</h1>
</div><div class="ClearBoth"></div>KevinKuszykWed, 28 Jan 2015 16:15:53 GMTUpdated Wiki: Home 20150128041553PNew Comment on "T4MVC_KnownIssues"https://t4mvc.codeplex.com/wikipage?title=T4MVC_KnownIssues&ANCHOR#C30924ApiControllers are not supported as wellcoolboy88Sat, 04 Oct 2014 09:29:20 GMTNew Comment on "T4MVC_KnownIssues" 20141004092920AUpdated Wiki: T4MVC_Historyhttps://t4mvc.codeplex.com/wikipage?title=T4MVC_History&version=37<div class="wikidoc"><h1>T4MVC change history</h1>
<h3>3.10.0 (9-18-2014)</h3>
<ul><li>Add support links in Areas. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/MatthewSteeples/LinksInAreas/contribution/7468">https://t4mvc.codeplex.com/SourceControl/network/forks/MatthewSteeples/LinksInAreas/contribution/7468</a></li></ul>
<h3>3.9.2 (8-7-2014)</h3>
<ul><li>Remove warning about methods not returning supported types. <a href="http://stackoverflow.com/questions/3312824/how-can-you-get-t4-to-skip-transforming-for-custom-methods/3315118">http://stackoverflow.com/questions/3312824/how-can-you-get-t4-to-skip-transforming-for-custom-methods/3315118</a></li>
<li>Add pragma to ignore CLS compliance warnings. <a href="https://t4mvc.codeplex.com/workitem/49">https://t4mvc.codeplex.com/workitem/49</a></li></ul>
<h3>3.9.1 (4-1-2014)</h3>
<ul><li>It&#39;s now possible to specify a folder from the project root that follows the &quot;FeatureFolder&quot;-convention (Settings-value: &quot;FeatureFolderRootArea&quot;).</li></ul>
<h3>3.9.0 (3-27-2014)</h3>
<ul><li>Added support for &quot;FeatureFolder&quot;-Convention where controllers and views are placed within one folder instead of separate ones. <a href="http://t4mvc.codeplex.com/discussions/479224">http://t4mvc.codeplex.com/discussions/479224</a></li></ul>
<h3>3.8.2 (3-10-2014)</h3>
<ul><li>Fix issue with linked files. <a href="https://t4mvc.codeplex.com/workitem/41">https://t4mvc.codeplex.com/workitem/41</a></li></ul>
<h3>3.8.1 (3-6-2014)</h3>
<ul><li>Improve support for Typescript files. <a href="https://t4mvc.codeplex.com/workitem/34">https://t4mvc.codeplex.com/workitem/34</a></li></ul>
<h3>3.8.0 (3-2-2014)</h3>
<ul><li>Add RedirectToAction overload that takes Task&lt;ActionResult&gt;. <a href="https://t4mvc.codeplex.com/discussions/535761">https://t4mvc.codeplex.com/discussions/535761</a></li>
<li>Fix JavaScriptReplacableUrl to correctly use ~/. <a href="https://t4mvc.codeplex.com/discussions/405911">https://t4mvc.codeplex.com/discussions/405911</a></li>
<li>Rename JavaScriptReplacableUrl to JavaScriptReplaceableUrl. I know, small breaking change, but not widely used. Live with it!</li></ul>
<h3>3.7.7 (2-23-2014)</h3>
<ul><li>Fix signing issue in 3.7.6. <a href="https://t4mvc.codeplex.com/discussions/533445">https://t4mvc.codeplex.com/discussions/533445</a></li></ul>
<h3>3.7.6 (2-20-2014)</h3>
<ul><li>Allow AddRouteValues to override values. <a href="https://t4mvc.codeplex.com/workitem/39">https://t4mvc.codeplex.com/workitem/39</a></li></ul>
<h3>3.7.5 (1-28-2014)</h3>
<ul><li>Make statuc MVC class partial. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/garyhunt/T4MVCpartial/contribution/6116">https://t4mvc.codeplex.com/SourceControl/network/forks/garyhunt/T4MVCpartial/contribution/6116</a></li>
<li>Mark action overloads as NonAction. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/garyhunt/T4MVCNonAction/contribution/6118">https://t4mvc.codeplex.com/SourceControl/network/forks/garyhunt/T4MVCNonAction/contribution/6118</a></li></ul>
<h3>3.7.4 (9-19-2013)</h3>
<ul><li>Set buildaction of t4 files to none. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/duncans/T4MVC/contribution/5356">https://t4mvc.codeplex.com/SourceControl/network/forks/duncans/T4MVC/contribution/5356</a></li></ul>
<h3>3.7.3 (8-09-2013)</h3>
<ul><li>Fix issue 23 - support for &#39;async Task&lt;ActionResult&gt;&#39; methods. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/5154">https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/5154</a></li></ul>
<h3>3.7.2 (8-07-2013)</h3>
<ul><li>Fix abstract view result method generation. <a href="https://t4mvc.codeplex.com/workitem/23">https://t4mvc.codeplex.com/workitem/23</a></li></ul>
<h3>3.7.1 (7-05-2013)</h3>
<ul><li>Fixed bug where AddRouteValue() throws ArgumentException if route value has already been added. <a href="https://t4mvc.codeplex.com/workitem/25">https://t4mvc.codeplex.com/workitem/25</a></li></ul>
<h3>3.7.0 (6-16-2013)</h3>
<ul><li>New AddAllViewsFoldersToStaticFilesFolders flag to include view folder files as static files (off by default) <a href="https://t4mvc.codeplex.com/discussions/445358">https://t4mvc.codeplex.com/discussions/445358</a></li>
<li>New ExcludedViewExtensions setting to not treat certain file extensions as views</li></ul>
<h3>3.6.5 (5-19-2013)</h3>
<ul><li>Use Controller constructor with least number of params. <a href="https://t4mvc.codeplex.com/workitem/22">https://t4mvc.codeplex.com/workitem/22</a></li></ul>
<h3>3.6.4 (5-08-2013)</h3>
<ul><li>Added support for checking files out with Perforce P4VS. <a href="https://t4mvc.codeplex.com/discussions/442992">https://t4mvc.codeplex.com/discussions/442992</a></li></ul>
<h3>3.6.3 (5-08-2013)</h3>
<ul><li>Fix assembly signing</li></ul>
<h3>3.6.2 (5-07-2013)</h3>
<ul><li>Avoid identifier conflict when content file names are similar. <a href="https://t4mvc.codeplex.com/discussions/441214">https://t4mvc.codeplex.com/discussions/441214</a></li></ul>
<h3>3.6.1 (5-03-2013)</h3>
<ul><li>Make actionresult classes partial. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/duncans/T4MVC/contribution/4632">https://t4mvc.codeplex.com/SourceControl/network/forks/duncans/T4MVC/contribution/4632</a></li></ul>
<h3>3.6.0 (4-26-2013)</h3>
<ul><li>Add support for task based actions. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/kev_bite/T4mvcTaskBasedActions/contribution/4564">https://t4mvc.codeplex.com/SourceControl/network/forks/kev_bite/T4mvcTaskBasedActions/contribution/4564</a></li></ul>
<h3>3.5.4 (4-22-2013)</h3>
<ul><li>Make action results internal to avoid cross project conflicts</li></ul>
<h3>3.5.3 (4-19-2013):</h3>
<ul><li>Add support for portable areas without a standard area folder</li></ul>
<h3>3.5.2 (3-07-2013):</h3>
<ul><li>Add support for inherited controller attributes. <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/4194">http://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/4194</a></li></ul>
<h3>3.5.1 (2-25-2013):</h3>
<ul><li>If static files include a timestamp, previously for minified CSS- and JavaScript-files the timestamp was generated by taking the last change time of the unminified file. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4122">https://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4122</a></li></ul>
<h3>3.5.0 (2-08-2013):</h3>
<ul><li>Sign T4MVCExtensions.dll <a href="http://t4mvc.codeplex.com/discussions/432534">http://t4mvc.codeplex.com/discussions/432534</a></li>
<li>Call T4Extension.TimestampString through delegate for unit testing <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4040">http://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4040</a></li></ul>
<h3>3.4.1 (1-31-2013):</h3>
<ul><li>Make T4MVCHelpers internal to avoid cross project conflicts <a href="http://t4mvc.codeplex.com/workitem/17">http://t4mvc.codeplex.com/workitem/17</a></li></ul>
<h3>3.4.0 (1-23-2013):</h3>
<ul><li>Add optional support for async methods <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/3958">https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/3958</a></li>
<li>Generate partial methods to allow custom &quot;overloading&quot; of the return values.</li></ul>
<h3>3.3.0 (1-16-2013):</h3>
<ul><li> Add support for support for model unbinder providers <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/Augi/T4MVCUnbinderProvider/contribution/3879">https://t4mvc.codeplex.com/SourceControl/network/forks/Augi/T4MVCUnbinderProvider/contribution/3879</a></li>
<li> Fix handling of &quot;completed&quot; methods <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/phw/t4mvc/contribution/3922">https://t4mvc.codeplex.com/SourceControl/network/forks/phw/t4mvc/contribution/3922</a></li></ul>
<h3>3.2.1 (12-27-2012):</h3>
<ul><li> Fix issue with VB projects causing exceptions <a href="http://t4mvc.codeplex.com/workitem/7">http://t4mvc.codeplex.com/workitem/7</a></li></ul>
<h3>3.2.0 (12-11-2012):</h3>
<ul><li> Add option to make parameter names constants <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/WayneBrantley/ParameterNamesToConst/contribution/3762">https://t4mvc.codeplex.com/SourceControl/network/forks/WayneBrantley/ParameterNamesToConst/contribution/3762</a></li></ul>
<h3>3.1.0 (12-09-2012):</h3>
<ul><li>Added JavaScriptReplacableUrl helper <a href="http://t4mvc.codeplex.com/discussions/405911">http://t4mvc.codeplex.com/discussions/405911</a></li></ul>
<h3>3.0.3 (11-30-2012):</h3>
<ul><li>Fix to deal with multiple attributes <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/ArtiomChi/t4mvc/contribution/3723">http://t4mvc.codeplex.com/SourceControl/network/forks/ArtiomChi/t4mvc/contribution/3723</a></li></ul>
<h3>3.0.2 (11-17-2012):</h3>
<ul><li>Add support for generic result types <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/ryanrust/T4MVC/contribution/3653">http://t4mvc.codeplex.com/SourceControl/network/forks/ryanrust/T4MVC/contribution/3653</a></li></ul>
<h3>3.0.1 (11-16-2012):</h3>
<ul><li>Fix T4MVC.tt.settings.xml so it only gets generated when needed <a href="https://t4mvc.codeplex.com/discussions/403390">https://t4mvc.codeplex.com/discussions/403390</a></li></ul>
<h3>3.0.0 (11-14-2012):</h3>
<ul><li>Move all the non-dynamic code to a separate T4MVCExtensions.dll assembly</li>
<li>Change generated code brace style to Allman</li>
<li>Added many new RouteLink/BeginRouteForm/RouteUrl helpers</li></ul>
<h3>2.13.0 (10-24-2012):</h3>
<ul><li>Move settings to T4MVC.tt.settings.xml XML file instead of tt file. See doc for details.</li>
<li>Make simple view names available alongside full names, e.g. MVC.Home.Views.SomeView vs MVC.Home.Views.ViewNames.SomeView</li></ul>
<h3>2.12.0 (10-16-2012):</h3>
<ul><li>Add support for static files in nested folders <a href="http://t4mvc.codeplex.com/workitem/6">http://t4mvc.codeplex.com/workitem/6</a></li>
<li>Add MVC 4 bundle starter classes <a href="https://t4mvc.codeplex.com/discussions/399205">https://t4mvc.codeplex.com/discussions/399205</a></li></ul>
<h3>2.11.2 (10-11-2012):</h3>
<ul><li>Removed optional params in ActionLink to support expression trees <a href="http://t4mvc.codeplex.com/workitem/4">http://t4mvc.codeplex.com/workitem/4</a></li>
<li>Change brace style of generated code to Allman</li></ul>
<h3>2.11.1 (10-10-2012):</h3>
<ul><li>Ignore methods that return generic types <a href="http://mvccontrib.codeplex.com/workitem/7178">http://mvccontrib.codeplex.com/workitem/7178</a></li></ul>
<h3>2.11.0 (10-09-2012):</h3>
<ul><li>Corrects the ActionParameters class for overloaded actions to list all parameters and not just the parameters from the first action found.</li></ul>
<h3>2.10.4 (10-05-2012):</h3>
<ul><li>Added attributes so it builds clean under Code Analysis <a href="http://t4mvc.codeplex.com/workitem/10">http://t4mvc.codeplex.com/workitem/10</a></li></ul>
<h3>2.10.3 (09-30-2012):</h3>
<ul><li>Fix crash when querystring contains a null key <a href="http://t4mvc.codeplex.com/discussions/396916">http://t4mvc.codeplex.com/discussions/396916</a></li></ul>
<h3>2.10.2 (09-17-2012):</h3>
<ul><li>Fix UnbindModel to avoid failing on duplicate entries <a href="http://t4mvc.codeplex.com/discussions/394529">http://t4mvc.codeplex.com/discussions/394529</a></li>
<li>Fix ModelUnbinder code generation when SplitIntoMultipleFiles is false <a href="http://t4mvc.codeplex.com/workitem/9">http://t4mvc.codeplex.com/workitem/9</a></li></ul>
<h3>2.10.1 (07-31-2012):</h3>
<ul><li>Fixed default param regression with model unbinder code (<a href="http://stackoverflow.com/questions/11566207/t4mvc-optionalparameter-values-implied-from-current-context/11603897">http://stackoverflow.com/questions/11566207/t4mvc-optionalparameter-values-implied-from-current-context/11603897</a>)</li></ul>
<h3>2.10.0 (07-03-2012):</h3>
<ul><li>Added support for custom model binders (<a href="https://t4mvc.codeplex.com/discussions/357386">https://t4mvc.codeplex.com/discussions/357386</a>)</li>
<li>Fixed unreachable code warning</li></ul>
<h3>2.9.0 (06-22-2012):</h3>
<ul><li>Added support for minified css files (<a href="https://t4mvc.codeplex.com/discussions/360443">https://t4mvc.codeplex.com/discussions/360443</a>)</li>
<li>Replaced improper new RouteValueDictionary usage on htmlAttributes</li></ul>
<h3>2.8.1 (04-12-2012):</h3>
<ul><li>Also default to https for the default (no param) action overload</li>
<li>Make T4MVCHelpers class public so that test code in a different assembly can access it</li></ul>
<h3>2.8 (03-25-2012):</h3>
<ul><li>Generate parameter constants for action methods. e.g. MVC.MyController.MethodParams.someParam</li>
<li>Default to https for Action Methods marked as RequireHttps (either at controller or action level)</li></ul>
<h3>2.7.0 (03-09-2012):</h3>
<ul><li>Removed support for MVC earlier than 3, and for CLR earlier than 4.0</li>
<li>Fix ActionLink to work with MVC4 (<a href="http://mvccontrib.codeplex.com/workitem/7191">http://mvccontrib.codeplex.com/workitem/7191</a>)</li></ul>
<h3>2.6.68 (02-03-2012):</h3>
<ul><li>Ignore static ctors when looking for ctors (<a href="http://mvccontrib.codeplex.com/workitem/7185">http://mvccontrib.codeplex.com/workitem/7185</a>)</li></ul>
<h3>2.6.67 (12-24-2011):</h3>
<ul><li>Restore Actions token that wasn&#39;t obsolete after all. Oops. (<a href="http://stackoverflow.com/questions/8625462/t4mvc-actions-token">http://stackoverflow.com/questions/8625462/t4mvc-actions-token</a>)</li></ul>
<h3>2.6.66 (12-22-2011):</h3>
<ul><li>Disable constant generation in UseLowercaseRoutes mode (<a href="http://stackoverflow.com/questions/8605868/t4mvc-2-6-65-and-uselowercaseroutes-true-error">http://stackoverflow.com/questions/8605868/t4mvc-2-6-65-and-uselowercaseroutes-true-error</a>)</li>
<li>Remove obsolete Actions token (<a href="http://stackoverflow.com/questions/8536269/what-is-the-difference-between-these-2-definitions-in-t4mvc/8543510">http://stackoverflow.com/questions/8536269/what-is-the-difference-between-these-2-definitions-in-t4mvc/8543510</a>)</li></ul>
<h3>2.6.65 (12-06-2011):</h3>
<ul><li>Add true constant strings for use in attributes (<a href="http://mvccontrib.codeplex.com/workitem/7177">http://mvccontrib.codeplex.com/workitem/7177</a>)</li></ul>
<h3>2.6.64 (10-21-2011):</h3>
<ul><li>Fix issue when action parameter name is escaped using @ syntax (e.g. int @event)</li></ul>
<h3>2.6.63 (10-13-2011):</h3>
<ul><li>Move hard coded T4MVC namespace into settings file</li></ul>
<h3>2.6.62 (08-13-2011):</h3>
<ul><li>Replace some unwanted tab characters with whitespace</li></ul>
<h3>2.6.61 (08-01-2011):</h3>
<ul><li>Ignore generic action methods (<a href="http://mvccontrib.codeplex.com/workitem/7156">http://mvccontrib.codeplex.com/workitem/7156</a>)</li></ul>
<h3>2.6.60 (07-28-2011):</h3>
<ul><li>Added support for portable areas. Enabled by adding area names to PortableAreas in T4MVC.tt.settings.t4</li>
<li>When generating links and views, if the folder name is the same as the parent, add a modifier to avoid class name conflicts (<a href="http://mvccontrib.codeplex.com/workitem/7153">http://mvccontrib.codeplex.com/workitem/7153</a>)</li></ul>
<h3>2.6.59 (07-12-2011):</h3>
<ul><li>Added commented out logic to show how to debug into the template (<a href="http://mvccontrib.codeplex.com/workitem/7144">http://mvccontrib.codeplex.com/workitem/7144</a>)</li>
<li>Ignore any class which name doesn&#39;t end with &quot;Controller&quot;</li></ul>
<h3>2.6.58 (06-24-2011):</h3>
<ul><li>Change the controller detection logic to be more reliable and ignore anything that doesn&#39;t extend Controller.</li></ul>
<h3>2.6.57 (06-21-2011):</h3>
<ul><li>Re-added Html.ActionLink/Url.Action overload without default params to avoid running into &quot;CS0854: An expression tree may not contain a call or invocation that uses optional arguments&quot;</li>
<li>Make ProcessControllerActionMethods look for ControllerBase instead of Controller to support controllers like MailerBase (from ActionMailer) which extend ControllerBase.</li></ul>
<h3>2.6.56 (06-05-2011):</h3>
<ul><li>Added optional Html.ActionLink parameters for protocol, hostname and fragment (<a href="http://stackoverflow.com/questions/6280347/how-can-i-add-a-hash-fragment-to-t4mvc-route-dictionary-actionresult/6302703">http://stackoverflow.com/questions/6280347/how-can-i-add-a-hash-fragment-to-t4mvc-route-dictionary-actionresult/6302703</a>)</li></ul>
<h3>2.6.55 (06-05-2011):</h3>
<ul><li>Added optional Url.Action parameters for protocol and hostname (<a href="http://stackoverflow.com/questions/6240568/t4mvc-doesnt-work-property-with-url-action">http://stackoverflow.com/questions/6240568/t4mvc-doesnt-work-property-with-url-action</a>)</li></ul>
<h3>2.6.54 (04-23-2011):</h3>
<ul><li>Added missing license to NuGet package and fixed some links. No actual template changes!</li></ul>
<h3>2.6.53 (04-18-2011):</h3>
<ul><li>Ignore actions marked as obsolete (<a href="http://mvccontrib.codeplex.com/workitem/7133">http://mvccontrib.codeplex.com/workitem/7133</a>)</li></ul>
<h3>2.6.52 (04-14-2011):</h3>
<ul><li>Moved the &#39;Dummy&#39; class under the GenerateMvcT4Extensions check</li>
<li>Always include the area token in the route values unless running on MVC 1.x</li></ul>
<h3>2.6.51 (04-12-2011):</h3>
<ul><li>Ignore async completion methods as they can&#39;t really be used in T4MVC, and can cause issues (<a href="http://stackoverflow.com/questions/5419173/t4mvc-asynccontroller">http://stackoverflow.com/questions/5419173/t4mvc-asynccontroller</a>)</li></ul>
<h3>2.6.50 (04-08-2011):</h3>
<ul><li>Added AddTimestampToStaticLink() method to settings file to allow more granular decision (per <a href="http://mvccontrib.codeplex.com/workitem/7129">this post</a>)</li>
<li>Added GenerateMvcT4Extensions settings flag to omit the generation of the System.Web.Mvc.T4Extensions class, which can be useful if it is already defined in a referenced library (see <a href="http://stackoverflow.com/questions/5563163/t4mvc-use-extension-methods-in-control-library/5574227">this post</a>)</li></ul>
<h3>2.6.44 (03-10-2011):</h3>
<ul><li>Added UseNonQualifiedViewNames flag which when set to true causes view names never to be fully qualified. Spark users may need that.</li></ul>
<h3>2.6.43 (02-24-2011):</h3>
<ul><li>Renamed T4MVC.settings.t4 to T4MVC.tt.settings.t4 so it feels more like a &#39;child&#39; file of T4MVC.tt</li></ul>
<h3>2.6.42 (02-01-2011):</h3>
<ul><li>Fix partial view support for MVC</li>
<li>Fix partial view support when name has periods (<a href="http://mvccontrib.codeplex.com/workitem/7113">http://mvccontrib.codeplex.com/workitem/7113</a>)</li></ul>
<h3>2.6.41 (01-17-2011):</h3>
<ul><li>Added AJAX BeginForm overloads</li></ul>
<h3>2.6.40 (01-05-2011):</h3>
<ul><li>Added BeginForm overload that just takes an ActionResult</li>
<li>Fix MapRouteArea to use UseNamespaceFallback when there are no namespaces</li></ul>
<h3>2.6.32 (12-15-2010):</h3>
<ul><li>Fix bug in controller name generation when IncludeAreasToken is true</li></ul>
<h3>2.6.31 (11-15-2010):</h3>
<ul><li>Improve error message when T4MVC generated files are out of date.</li>
<li>Changed some &#39;const bool&#39; settings to &#39;static bool&#39; to avoid unused code warnings.</li>
<li>Disabled regen optimization added in 2.6.14 since it doesn&#39;t catch view changes</li></ul>
<h3>2.6.30 (09-05-2010):</h3>
<ul><li>Changed ExplicitHtmlHelpersForPartials flag to be off by default (and fix a small issue when it&#39;s off)</li>
<li>Handled System.NotImplementedException if project type (e.g. Installer) does not implement CodeModel property</li>
<li>Fixed issue when action method params are all optional (<a href="http://stackoverflow.com/questions/3488610/t4mvc-and-named-parameters">http://stackoverflow.com/questions/3488610/t4mvc-and-named-parameters</a>)</li>
<li>Exclude Area related methods when using MVC 1.0, as that was breaking things</li>
<li>Added logic to special case DisplayTemplates/EditorTemplates folders, since they need short view names passed in</li></ul>
<h3>2.6.21 (07-20-2010):</h3>
<ul><li>Fix to the partial extension feature added in 2.6.20 to deal with conflicts</li></ul>
<h3>2.6.20 (07-19-2010):</h3>
<ul><li>Added extension methods to render partial views (see <a href="http://www.weirdlover.com/2010/05/12/t4mvc-extension-for-mvc-partials/">this post</a>)
<ul><li>e.g. Html.RenderPartial(&quot;Map&quot;, Model.Dinner); --&gt; Html.RenderMap(Model.Dinner);</li>
<li>Can be turned off in settings file via ExplicitHtmlHelpersForPartials flag.</li></ul></li></ul>
<h3>2.6.15 (05-16-2010):</h3>
<ul><li>Added missing MapRoute overloads to support namespaces</li>
<li>Added MapRoute extensions on AreaRegistrationContext to support areas. Had to name them MapRouteArea to avoid clash with existing MapRoute methods :(</li></ul>
<h3>2.6.14 (05-06-2010):</h3>
<ul><li>Added UseLowercaseRoutes flag to lower case the area, controller and action names in routes</li>
<li>Added support for Views folders that don&#39;t match a controller name.</li>
<li>Added optimization to not regenerate files when the controller has not changed since the last generation</li>
<li>Turn AlwaysKeepTemplateDirty to false by default. We now have an <a href="http://blogs.msdn.com/davidebb/archive/2010/03/18/an-even-better-way-to-run-t4mvc-a-vs-addin.aspx">addin</a> which provides a better solution to this</li></ul>
<h3>2.6.13 (03-08-2010):</h3>
<ul><li>Added AddTimestampToStaticLinks flag to T4MVC.settings.t4 to generate static links that change when the file changes.</li>
<li>Added support for [Bind(Prefix = &quot;newParamName&quot;)] attribute so it generates the correct route value</li>
<li>Added an AddRouteValues overload that takes NameValueCollection, e.g.
<ul><li>MVC.Home.About().AddRouteValues(Request.QueryString)</li></ul></li>
<li>Added MapRoute overload that supports contraints</li>
<li>Removed some logic to support VS2010 Beta 2. VS2010 RC or later should now be used.</li></ul>
<h3>2.6.12 (01-15-2010):</h3>
<ul><li>Fixed issue where some special project types (e.g. DB projects) were throwing while enumerating over the list</li>
<li>Changed to use GeneratedCode attribute instead of the less correct CompilerGenerated</li>
<li>Fixed CompilerGenerated/DebuggerNonUserCode attributes so they don&#39;t incorrectly affect the control classes</li>
<li>Change to avoid adding area to route if the app is not using areas</li></ul>
<h3>2.6.11 (01-10-2010):</h3>
<ul><li>Added ExcludedStaticFileExtensions setting to T4MVC.settings.t4 to list extensions for which static links should not be generated.</li>
<li>Support configurable name for IT4MVCActionResult, and it being defined externally (for sharing pourpose)</li>
<li>Added DebuggerNonUserCode attribute to generated classes</li>
<li>Improved error handling when trying to call T4MVC method with real ActionResult (previous threw InvalidCast)</li>
<li>Fix issue when overridden action methods were incorrectly marked as virtual</li></ul>
<h3>2.6.10 (01-04-2010):</h3>
<ul><li>Added support for adding arbitrary route parameters to T4MVC actions. e.g.
<ul><li>MVC.Home.About().AddRouteValue(&quot;fooKey&quot;, bar.Foo.Key)</li>
<li>MVC.Home.About().AddRouteValues(new {fooKey = bar.Foo.Key, barKey = bar.Key})</li></ul></li>
<li>Added shorter to refer to controller actions from with the controller itself. e.g.
<ul><li>return RedirectToAction(MVC.MyController.Actions.About()); BECOMES:</li>
<li>return RedirectToAction(Actions.About());</li></ul></li>
<li>What was previously called Actions was renamed to ActionNames (note, that&#39;s a BREAKING CHANGE if you used Actions before!)</li>
<li>Ignore controller methods that are marked with a NonAction attribute</li>
<li>Renamed IT4MVCActionResult.RouteValues to avoid conflict (this should not break anything, as it&#39;s only used internally)</li></ul>
<h3>2.6.03 (12-10-2009):</h3>
<ul><li>Generate full view paths to allow cross controller references
<ul><li>e.g. MVC.Dinners.Views.DinnerForm is now &quot;~/Views/Dinners/DinnerForm.ascx&quot; instead of just &quot;DinnerForm&quot;</li></ul></li>
<li>Fix compile error when a view name is a language keyword (e.g. string.ascx)</li></ul>
<h3>2.6.02 (12-04-2009)</h3>
<ul><li>Added way to get area name from both Area and Controller objects
<ul><li>e.g. MVC.MyArea.Name and MVC.MyArea.MyController.Area</li></ul></li>
<li>Added support for controllers in the default namespace (i.e. no namespace)</li>
<li>Always include the area in the route data, even when it&#39;s null/empty</li></ul>
<h3>2.6.01 (12-02-2009)</h3>
<ul><li>Fix compile error when a custom ActionResult type has a ctor that takes a value type</li></ul>
<h3>2.6.00 (11-28-2009)</h3>
<ul><li>Added support for MVC 2 Areas</li>
<li>Fixed issue where non-existing RenderAction method gets generated on VS2010 Beta 2</li>
<li>Added check to give proper error when attempting to run T4MVC outside VS (e.g. from TextTransform.exe)</li></ul>
<h3>2.5.02 (11-24-2009)</h3>
<ul><li>Change links in comment to point to new T4MVC home and forum</li>
<li>Fix scenario where a View folder as a name that&#39;s a C# keyword</li></ul>
<h3>2.5.01 (11-20-2009)</h3>
<ul><li>Added support for Html.RenderAction and Html.Action (see http://haacked.com/archive/2009/11/18/aspnetmvc2-render-action.aspx)</li>
<li>Fix null ref exception issue when custom ActionResult type doesn&#39;t have any explicit ctors</li></ul>
<h3>2.5.00 (11-16-2009)</h3>
<ul><li>Incorporated Damien Guard&#39;s multiple output manager to (optionally) split output from T4MVC into separate files to improve source control</li>
<li>Added support for minified javascript files in production</li>
<li>Fixed bug occurring when no action is of type ActionResult</li></ul>
<h3>2.4.04 (10-15-2009)</h3>
<ul><li>Added support for MVC 2 by detecting the version and generating slightly different code</li></ul>
<h3>2.4.03 (10-02-2009)</h3>
<ul><li>Added ProcessVirtualPath method to T4MVC.settings.t4 so user can write custom logic to modify client URL&#39;s</li>
<li>Greatly simplified GetProjectContainingT4File logic by using FindProjectItem().</li>
<li>Renamed generated classes to be CLS compliant</li>
<li>Moved most of the doc and versioning comments from T4MVC.tt into the readme.txt file, as it was getting a bit long.</li></ul>
<h3>2.4.02 (09-02-2009)</h3>
<ul><li>Added a setting in T4MVC.settings.t4 to set the namespace that Links get generated in</li>
<li>Added pragma to prevent compiler from complaining about missing Xml comments</li>
<li>Added &lt;auto-generated /&gt; comment to disable StyleCop in generated file</li>
<li>Fixed issue when using a custom ResultType in a custom namespace. Now fully qualifying result types.</li></ul>
<h3>2.4.01 (07-29-2009):</h3>
<ul><li>Put all the generated code in a T4MVC #region. This is useful to tell tools like ReSharper to ignore it.</li>
<li>Fixed issue where controller methods returning generic types cause template to blow up</li>
<li>Added a setting in T4MVC.settings.t4 to turn off the behavior that always keeps the template dirty</li></ul>
<h3>2.4.00 (07-28-2009):</h3>
<ul><li>Added support for configurable settings in a separate T4MVC.settings.t4 file</li>
<li>Added a parameter-less pseudo-action for every action that doesn&#39;t already have a parameter-less overload</li>
<li>Added support for having T4MVC.tt in a sub folder instead of always at the root of the project</li>
<li>Fixed issue when a base controller doesn&#39;t have a default ctor</li>
<li>Added T4Extensions into System.Web.Mvc namespace to fix ambiguous resolution issue </li>
<li>Misc cleanup</li></ul>
<h3>2.3.01 (07-10-2009):</h3>
<ul><li>Fixed issue with <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName&referringTitle=T4MVC_History">ActionName</a> attribute set to non literal string values (e.g. <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName%28SomeConst%20%2b%20%22Abc%22%29&referringTitle=T4MVC_History">ActionName&#40;SomeConst &#43; &#34;Abc&#34;&#41;</a>)</li>
<li>Fixed duplication issue when partial controller classes have a base type which contains action methods</li>
<li>Skip App_LocalResources when processing views</li>
<li>Cleaned up rendering logic</li></ul>
<h3>2.3.00 (07-07-2009):</h3>
<ul><li>Added support for sub view folders</li>
<li>Added support for <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName&referringTitle=T4MVC_History">ActionName</a> attribute</li>
<li>Improved handling when the controller comes from a different project</li>
<li>Don&#39;t try to process generic controller classes</li></ul>
<h3>2.2.03 (07-06-2009):</h3>
<ul><li>Added support for action methods defined on controller base classes</li>
<li>Improved error handling when not able to change actions to virtual and controllers to partial</li></ul>
<h3>2.2.02 (07-01-2009):</h3>
<ul><li>Fixed break caused by incorrect support for derived ActionResult types in 2.2.01</li>
<li>Fixed issue with duplicate view tokens getting generated when you have both foo.aspx and foo.ascx</li></ul>
<h3>2.2.01 (07-01-2009):</h3>
<ul><li>Added support for action methods that return a type derived from ActionResult (as opposed to exactly an ActionResult)</li>
<li>Fixed issue when controller is using partial classes</li>
<li>Fixed folder handling logic to deal with generated files</li>
<li>Fixed issue with folder names that are C# keyword</li>
<li>Throw NotSupportedException instead of NotImplementedException to avoid being viewed as a TODO</li></ul>
<h3>2.2.00 (06-30-2009):</h3>
<ul><li>Added strongly typed support to MapRoute</li>
<li>Changed constructor generation to avoid confusing IoC containers</li>
<li>Fixed issue with empty Content folder</li>
<li>Fixed issue with abstract controller base classes</li></ul>
<h3>2.1.00 (06-29-2009):</h3>
<ul><li>Added Html.BeginForm overloads that use the strongly typed pattern</li>
<li>Added Url() helpers on static resources to increase flexibility</li>
<li>Changed generated constants (view and action names, static files) to be readonly strings</li>
<li>Fixed null ref exception in Solution Folder logic</li></ul>
<h3>2.0.04 (06-28-2009):</h3>
<ul><li>Fixed issue with files and folders with names starting with a digit</li></ul>
<h3>2.0.03 (06-27-2009):</h3>
<ul><li>Rework code element enumeration logic to work around a VS2010 issue. The template should now work with VS2010 beta 1!</li>
<li>Reduced some redundancy in the generated code</li></ul>
<h3>2.0.02 (06-27-2009):</h3>
<ul><li>Added ActionLink overloads that take object instead of dictionary (from both Html and Ajax)</li></ul>
<h3>2.0.01 (06-26-2009):</h3>
<ul><li>Fixed issue with files and folders with invalid identifier characters (e.g. spaces, &#39;-&#39;, &#39;.&#39;)</li></ul>
<h3>2.0.00 (06-26-2009):</h3>
<ul><li>Added support for refactoring in Action methods</li>
<li>The T4 file automatically runs whenever you build, instead of being done manually</li>
<li>Support for strongly typed links to static resources</li>
<li>Fix: supports controllers that are in sub-folders of the Controllers folder and not directly in there</li>
<li>Fix: works better with nested solution folder </li>
<li>Random other small fixes</li></ul>
<h3>1.0.xx (06-17-2009):</h3>
<ul><li>the original based on <a href="http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx">this post</a></li></ul>
</div><div class="ClearBoth"></div>davidebboThu, 18 Sep 2014 18:57:36 GMTUpdated Wiki: T4MVC_History 20140918065736PUpdated Wiki: Documentationhttps://t4mvc.codeplex.com/documentation?version=18<div class="wikidoc"><h1>T4MVC Documentation page</h1>
<h2>1. Introduction</h2>
T4MVC is a T4 template for ASP.NET MVC apps that creates strongly typed helpers that eliminate the use of literal strings when referring the controllers, actions and views. It helps make your MVC code much more maintainable, and gives you intellisense where you normally would not have any. It was started by <a href="http://twitter.com/#!/davidebbo">David Ebbo</a> as a little blog post thing, and has since gained many new features based on great community feedback.<br /><br />T4MVC runs in Visual Studio 2010, 2012 and 2013, and supports ASP.NET MVC 4.0 and 5.0 (older MVCs may work but are untested).<br /><br />To use it, simply install the T4MVC package using NuGet. You will get T4MVC.tt in your project, and will instantly see a number of files get created in Visual Studio under it.<br /><br />The code in those generated files enable a whole range of scenarios, all relating to replacing unwanted literal strings with a strongly typed alternative. The documentation below gives a complete list of those scenarios.<br />
<h3>1.1 It&#39;s still just standard MVC under the cover</h3>
One key concept to understand about T4MVC is that it is just a thin layer over MVC. e.g. while it provides strong typing, in the end it&#39;s just putting values in a dictionary, and using standard MVC to generate the routes.<br /><br />One thing I often suggest when people have questions is to first figure out how they would do things without T4MVC. If you have no idea how it would work, or think it may not be possible at all, then you are probably expecting too much of T4MVC! Generally, it will not do anything that MVC does not support.<br />
<h2>2. Scenarios</h2>
Instead of a formal documentation, we&#39;ll just demonstrate by example the various scenarios where T4MVC helps improve your code. The examples are shown in a before/after format to outline the change that is made.<br /><br />Note: a lot of the examples given below are based on the <a href="http://nerddinner.codeplex.com/">Nerd Dinner</a> sample MVC application. <br />
<h3>2.1 Using View Name constants</h3>
<br />Any time you would use a literal string to refer to a view, T4MVC gives you a strongly typed alternative. e.g. suppose you have this code in a view:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;% Html.RenderPartial(<span style="color:#A31515;">&quot;DinnerForm&quot;</span>); %&gt;
</pre></div>This ugly “DinnerForm” literal string needs to go! Instead, you can now write:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;% Html.RenderPartial(MVC.Dinners.Views.DinnerForm); %&gt;
</pre></div><br />When you need to use a view name inside a controller, things get even easier. e.g. you can replace:<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> View(<span style="color:#A31515;">&quot;InvalidOwner&quot;</span>);
</pre></div>by<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> View(Views.InvalidOwner);
</pre></div><br />Note how you can omit the MVC.Dinners prefix, since this is implied by the fact that the code lives in the Dinners controller.<br />
<h4>2.1.1 Non-Qualified View Name Constants</h4>
Non-qualified view names can be used via the ViewNames property underneath the Views property. Non-qualified views are usefull for allowing overloading and are needed by certain setups, e.g. Spark.<br /><br />Traditional &quot;Magic String&quot; Non-Qualified view:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> View(<span style="color:#A31515;">&quot;Index&quot;</span>);
</pre></div><br />T4MVC Non-Qualified view:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> View(Views.ViewNames.Index);
</pre></div>
<h3>2.2 Referring to controller actions</h3>
<br />Many MVC APIs follow a pattern where you need to pass three pieces of information in order to refer to a controller action:<br />
<ol><li>the controller name (often implied when dealing with the current controller)</li>
<li>the action method name</li>
<li>the parameters to be passed to the action method</li></ol>
<br />All of this is typically done by passing literal strings for #1 and #2, and an anonymous object for #3, e.g.<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, <span style="color:#A31515;">&quot;Delete&quot;</span>, <span style="color:#A31515;">&quot;Dinners&quot;</span>, <span style="color:Blue;">new</span> { id = Model.DinnerID }, <span style="color:Blue;">null</span>)%&gt;
</pre></div>Here, &quot;Delete&quot; and &quot;Dinners&quot; are clear literal strings that we&#39;d like to get rid of. But that&#39;s not all, as the paramter name &#39;id&#39; is as much of a problem as those other two. Even though it doesn’t look like a literal string, it very much is one in disguise. Don’t let those anonymous objects fool you!<br /><br />With T4MVC, you would instead write:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Dinners.Delete(Model.DinnerID))%&gt;
</pre></div>Basically, we got rid of the three unwanted literal strings (“Delete”, &quot;Dinners&quot; and “Id”), and replaced them by a very natural looking method call to the controller action. Of course, this is not really calling the controller action, which would be very wrong here. But it’s capturing the essence of method call, and turning it into the right route values.<br /><br />One other great benefit of this approach is that you get full intellisense while you type this line. In fact, you even get full refactoring support if you use a tool like resharper which supports aspx refactoring!<br />
<h4>Adding additional route parameters</h4>
In some situation, you may need to add extra values to the route that don’t exist in the action method. You can do it as follows:<br /><br /><div style="color:Black;background-color:White;"><pre>
Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Dinners.Delete(Model.DinnerID)
.AddRouteValue(<span style="color:#A31515;">&quot;foo&quot;</span>, 17))
</pre></div><br />You can add multiple values this way using a fluent approach, e.g.<br /><br /><div style="color:Black;background-color:White;"><pre>
Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Dinners.Delete(Model.DinnerID)
.AddRouteValue(<span style="color:#A31515;">&quot;foo&quot;</span>, 17)
.AddRouteValue(<span style="color:#A31515;">&quot;bar&quot;</span>, <span style="color:#A31515;">&quot;abc&quot;</span>))
</pre></div><br />As an alternative for adding multiple values, you can write:<br /><br /><div style="color:Black;background-color:White;"><pre>
Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Dinners.Delete(Model.DinnerID)
.AddRouteValues(<span style="color:Blue;">new</span> { foo = 17, bar = <span style="color:#A31515;">&quot;abc&quot;</span>}))
</pre></div><br />Note that in some cases, you may want to omit the action method parameters from the route, possibly because they are meant to come from form data and not from the URL. For those cases, you can always use the parameter-less override that T4MVC generates (that part is not new), e.g.<br /><br /><div style="color:Black;background-color:White;"><pre>
Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Dinners.Delete()
.AddRouteValues(<span style="color:Blue;">new</span> { foo = 17, bar = <span style="color:#A31515;">&quot;abc&quot;</span>}))
</pre></div><br />Now suppose you want to add all the current query string values to the route values produced by T4MVC. You can use the AddRouteValues() overload that takes a NameValueCollection. e.g.<br /><br /><div style="color:Black;background-color:White;"><pre>
RedirectToAction(MVC.Home.MyAction().AddRouteValues(Request.QueryString));
</pre></div><br />This adds to the existing set of AddRouteValue/AddRouteValues fluent APIs to make it easier to deal with all kind different situations.<br /><br />The nice thing about this fluent approach is that it doesn’t require adding overloads to all the T4MVC helpers (e.g. Html.ActionLink is this case) to take in the extra route values. Instead, it automatically applies to any method that uses the T4MVC pattern.<br /><br />The general pattern of making a pseudo-call to a controller action is used is many places in T4MVC:<br />
<h4>2.2.1 Html.ActionLink</h4>
Ok, we just covered that one above.<br />
<h4>2.2.2 Url.Action</h4>
<div style="color:Black;background-color:White;"><pre>
&lt;%= Url.Action(MVC.Dinners.Delete(Model.DinnerID))%&gt;
</pre></div>
<h4>2.2.2a Url.JavaScriptReplacableUrl</h4>
Two use cases for the above. <br /><br /><b>1st Use Case:</b><br />If you have an action you want to call from javascript like this:<br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Url.Action(MVC.Dinners.Display(Model.DinnerID))%&gt;
</pre></div>Odds are you want to get the Model.DinnerID from a javascript variable. So you end up with<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">var</span> myUrl=&lt;%= Url.Action(MVC.Dinners.Display())%&gt;
<span style="color:Green;">//myUrl will be /Dinners/Display</span>
<span style="color:Blue;">var</span> myFinalUrl=myUrl+<span style="color:#A31515;">&quot;/&quot;</span>+dinnerId; <span style="color:Green;">///Dinners/Display/12</span>
<span style="color:Green;">//or does it look like </span>
<span style="color:Blue;">var</span> myFinalUrl=myUrl+<span style="color:#A31515;">&quot;?dinnerID&quot;</span>+dinnerId; <span style="color:Green;">///Dinners/Display?dinnerId=12</span>
</pre></div>The issue is you are not sure how to compose the URL and if it changes, this will silently break.<br /><br /><b>2nd Use Case:</b><br />For the above action in your routing table you created a route like:<br />&quot;Dinners/Display/{dinnerId}&quot; - and you constrain dinnerId to be an integer larger than zero.<br /><br />Now, if you do the same scenario above:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">var</span> myUrl=&lt;%= Url.Action(MVC.Dinners.Display())%&gt;
</pre></div>The route will not be found - because there is not a route match (since dinnerId was not provided).<br /><br /><b>JavaScriptReplacableUrl solves both of these issues</b><br />No matter which use case, you define a specific route for the action (constrained parameters or not)<br />In the routing table you add:<br />&quot;Dinners/Display/{dinnerId}&quot; - (constrain dinnerId if you want)<br /><b>Note: You must define a specific route for JavaScriptReplacableUrl to work like this - it cannot work with &#39;default routes&#39;. If it cannot find a matching route it behaves like Url.Action().</b><br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">var</span> myUrl=&lt;%= Url.JavaScriptReplacableUrl(MVC.Dinners.Display())%&gt;
<span style="color:Green;">//myUrl will be Dinners/Display/{dinnerId} </span>
<span style="color:Blue;">var</span> myFinalUrl=myUrl.replace(<span style="color:#A31515;">&quot;{dinnerId}&quot;</span>, dinnerId); <span style="color:Green;">//this will have whatever route shape you defined in routing table!</span>
</pre></div><br />Note you can use the parameter name constants from T4MVC (and that will give you compile time checking for parameter name changes:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">var</span> myFinalUrl=myUrl.replace(<span style="color:#A31515;">&quot;{&quot;</span>+MVC.Dinners.DisplayParams.dinnerId+<span style="color:#A31515;">&quot;}&quot;</span>, dinnerId); <span style="color:Green;">//this will have whatever route shape you defined </span>
</pre></div><br />
<h4>2.2.3 Ajax.ActionLink</h4>
<div style="color:Black;background-color:White;"><pre>
&lt;%= Ajax.ActionLink( <span style="color:#A31515;">&quot;RSVP for this event&quot;</span>,
<span style="color:#A31515;">&quot;Register&quot;</span>, <span style="color:#A31515;">&quot;RSVP&quot;</span>,
<span style="color:Blue;">new</span> { id=Model.DinnerID },
<span style="color:Blue;">new</span> AjaxOptions { UpdateTargetId=<span style="color:#A31515;">&quot;rsvpmsg&quot;</span>, OnSuccess=<span style="color:#A31515;">&quot;AnimateRSVPMessage&quot;</span> }) %&gt;
</pre></div>becomes<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Ajax.ActionLink( <span style="color:#A31515;">&quot;RSVP for this event&quot;</span>,
MVC.RSVP.Register(Model.DinnerID),
<span style="color:Blue;">new</span> AjaxOptions { UpdateTargetId=<span style="color:#A31515;">&quot;rsvpmsg&quot;</span>, OnSuccess=<span style="color:#A31515;">&quot;AnimateRSVPMessage&quot;</span> }) %&gt;
</pre></div>
<h4>2.2.4 RedirectToAction (in controller code)</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> RedirectToAction(<span style="color:#A31515;">&quot;Details&quot;</span>, <span style="color:Blue;">new</span> { id = dinner.DinnerID });
</pre></div>becomes<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> RedirectToAction(MVC.Dinners.Details(dinner.DinnerID));
</pre></div>
<h4>2.2.5 routes.MapRoute (typically in global.asax)</h4>
<div style="color:Black;background-color:White;"><pre>
routes.MapRoute(
<span style="color:#A31515;">&quot;UpcomingDinners&quot;</span>,
<span style="color:#A31515;">&quot;Dinners/Page/{page}&quot;</span>,
<span style="color:Blue;">new</span> { controller = <span style="color:#A31515;">&quot;Dinners&quot;</span>, action = <span style="color:#A31515;">&quot;Index&quot;</span> }
);
</pre></div>becomes<br /><br /><div style="color:Black;background-color:White;"><pre>
routes.MapRoute(
<span style="color:#A31515;">&quot;UpcomingDinners&quot;</span>,
<span style="color:#A31515;">&quot;Dinners/Page/{page}&quot;</span>,
MVC.Dinners.Index(<span style="color:Blue;">null</span>)
);
</pre></div>
<h4>2.2.6 Html.BeginForm</h4>
Essentially, it’s the same support as ActionLink() but for the BeginForm() method. But note that because form posts typically pass most of the data via the form and not the URL, BeginForm() is trickier to use correctly than the other methods.<br /><br />Here is how you might use this:<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">using</span> (Html.BeginForm(MVC.Account.LogOn(), FormMethod.Post)) { ... }
</pre></div>Or if the action method takes parameters, you would pass them in the call. However, when you do this you need to make sure that you aren’t also trying to pass those same parameters via the form (e.g. using a text box).<br /><br />Generally, the rule of thumb is that this support works well when you’re dealing with forms where the Action method signature exactly matches the form URL.<br />
<h4>2.2.7 Html.RenderAction and Html.Action (only in MVC 2 or newer)</h4>
These are new to MVC 2. See Phil Haack&#39;s <a href="http://haacked.com/archive/2009/11/18/aspnetmvc2-render-action.aspx">post</a> about them for details.<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.Action(<span style="color:#A31515;">&quot;Menu&quot;</span>, <span style="color:Blue;">new</span> { options = <span style="color:Blue;">new</span> MenuOptions { Width=400, Height=500} })%&gt;
</pre></div>becomes<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.Action(MVC.Home.Menu(<span style="color:Blue;">new</span> MenuOptions { Width=400, Height=500})); %&gt;
</pre></div>Same deal for Html.RenderAction.<br />
<h3>2.3. Use constants to refer to area, controller, action and parameter names</h3>
<h4>2.3.1 Area name constants</h4>
<div style="color:Black;background-color:White;"><pre>
MVC.CoolArea.Name
</pre></div>
<h4>2.3.2 Controller name constants</h4>
<div style="color:Black;background-color:White;"><pre>
MVC.Home.Name
</pre></div>
<h4>2.3.3 Action name constants</h4>
<div style="color:Black;background-color:White;"><pre>
MVC.Home.ActionNames.Index
</pre></div>
<h4>2.3.4 Parameter name constants</h4>
Assuming a Home.MyAction action that takes a foo parameter, this evaluates to &quot;foo&quot;:<br /><br /><div style="color:Black;background-color:White;"><pre>
MVC.Home.MyActionParams.foo
</pre></div><br />
<h3>2.4. Strongly typed links to script files and static resources</h3>
<br />T4MVC generates static helpers for your content files and script files. So instead of writing:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;img src=<span style="color:#A31515;">&quot;/Content/nerd.jpg&quot;</span> /&gt;
</pre></div>You can write:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;img src=<span style="color:#A31515;">&quot;&lt;%= Links.Content.nerd_jpg %&gt;&quot;</span> /&gt;
</pre></div>Likewise, instead of<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;script src=<span style="color:#A31515;">&quot;/Scripts/Map.js&quot;</span> type=<span style="color:#A31515;">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;
</pre></div>You can write<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;script src=<span style="color:#A31515;">&quot;&lt;%= Links.Scripts.Map_js %&gt;&quot;</span> type=<span style="color:#A31515;">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;
</pre></div><br />Additionally T4MVC also scans the Areas for content folders and create static helpers for these too. e.g. if you have an area called CustomerPortal with its own logo then it would look like the following:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;img src=<span style="color:#A31515;">&quot;&lt;%= Links.Areas.CustomerPortal.Content.Logo_png %&gt;&quot;</span> /&gt;
</pre></div><br />The obvious benefit is that you’ll get a compile error if you ever move or rename your static resource, so you’ll catch it earlier.<br /><br />Another benefit is that you get a more versatile reference. When you write src=&quot;/Content/nerd.jpg&quot;, your app will only work when it’s deployed at the root of the site. But when you use the helper, it executes some server side logic that makes sure your reference is correct wherever your site is rooted. It does this by calling VirtualPathUtility.ToAbsolute(&quot;~/Content/nerd.jpg&quot;).<br /><br />One unfortunate thing is that for some reason, VS doesn’t support intellisense in the view for parameter values. As a workaround, you can type it outside of the tag to get intellisense and then copy it there.<br /><br /><b>Important note</b>: if you see strange links getting generated in your &lt;head&gt; tag, you just need to remove the runat=&quot;server&quot; from it.<br />
<h4> Support for MVC&#39;s script and style bundles</h4>
Starting from MVC4, one can define &quot;bundles&quot; of scripts and stylesheets which are automatically combined and minified. However, magic strings are used to define the resource URLs. To eliminate them, follow steps 1 to 3 below.<br /><br />1. Add the following to your own code, which will extend T4MVC&#39;s static partial &quot;Links.bundles.scripts&quot; and &quot;Links.bundles.styles&quot; classes:<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">namespace</span> Links {
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">partial</span> <span style="color:Blue;">class</span> bundles {
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">partial</span> <span style="color:Blue;">class</span> scripts {
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">readonly</span> <span style="color:Blue;">string</span> jquery = <span style="color:#A31515;">&quot;~/scripts/jquery&quot;</span>;
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">readonly</span> <span style="color:Blue;">string</span> jqueryui = <span style="color:#A31515;">&quot;~/scripts/jqueryui&quot;</span>;
}
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">partial</span> <span style="color:Blue;">class</span> styles {
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">readonly</span> <span style="color:Blue;">string</span> bootstrap = <span style="color:#A31515;">&quot;~/styles/boostrap&quot;</span>;
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">readonly</span> <span style="color:Blue;">string</span> theme = <span style="color:#A31515;">&quot;~/styles/theme&quot;</span>;
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">readonly</span> <span style="color:Blue;">string</span> common = <span style="color:#A31515;">&quot;~/styles/common&quot;</span>;
}
}
}
</pre></div><br />Notice how the magic strings are now defined in one place only, and are thus easy to maintain.<br /><br />2. Use the following to add your bundles to the runtime:<br /><br /><div style="color:Black;background-color:White;"><pre>
bundles.Add(<span style="color:Blue;">new</span> ScriptBundle(Links.bundles.scripts.jquery).Include(<span style="color:#A31515;">&quot;~/scripts/jquery-{version}.js&quot;</span>));
bundles.Add(<span style="color:Blue;">new</span> StyleBundle(Links.bundles.styles.bootstrap).Include(<span style="color:#A31515;">&quot;~/styles/bootstrap*.css&quot;</span>));
</pre></div><br />3. Use the following to use a bundle in a cshtml layout/view:<br /><br /><div style="color:Black;background-color:White;"><pre>
@Scripts.Render(Links.bundles.scripts.jquery)
@Styles.Render(Links.bundles.scripts.bootstrap)
</pre></div>
<h4>Support for Minified Javascript files</h4>
Minified javascript files are alternate version of the files that makes them as small as possible, but using various strategies like removing white space. e.g. in an MVC application’s Scripts folder, you’ll typically see both jquery-1.3.2.js and jquery-1.3.2.min.js. Usually, you want to use the minified version at deployment time (to make your site load faster), but the regular version at development time, so you can more easily debug into it.<br /><br />T4MVC makes it automatic to use one vs. the other depending on the context. e.g. suppose you have:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;script src=<span style="color:#A31515;">&quot;&lt;%= Links.Scripts.jquery_1_2_6_js %&gt;&quot;</span> type=<span style="color:#A31515;">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;
</pre></div>You don’t need to change anything to this line, but the token jquery_1_2_6_js will automatically point to either jquery-1.3.2.js or jquery-1.3.2.min.js depending on whether you’re running in production. How does it know whether you’re in production? It calls a method defined in T4MVC.tt.hooks.t4 which makes the decision. By default, it looks at whether debugging is enabled:<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">// Logic to determine if the app is running in production or dev environment</span>
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">bool</span> IsProduction() {
<span style="color:Blue;">return</span> (HttpContext.Current != <span style="color:Blue;">null</span> &amp;&amp; !HttpContext.Current.IsDebuggingEnabled);
}
</pre></div><br />But you can easily change this logic if you have a different way of determining ‘production’.<br />
<h3>2.5 Using T4MVC with &quot;Areas&quot;</h3>
<br />One of MVC 2&#39;s major new features is the support for breaking up a large application into &quot;Areas&quot;. This works by following a structure that looks like:<br />
<ul><li>Root folder
<ul><li>Areas
<ul><li>NerdDinner
<ul><li>Models</li>
<li>Views</li>
<li>Controllers</li></ul></li>
<li>Wiki
<ul><li>Models</li>
<li>Views</li>
<li>Controllers</li></ul></li></ul></li></ul></li></ul>
<br />T4MVC automatically works with your areas and makes them available in its object model. Here is an example:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.NerdDinner.Dinners.Delete(Model.DinnerID))%&gt;
</pre></div>Notice how we refered to the controller as MVC.<b>NerdDinner</b>.Dinners. Note that if you happen to have a top level controller with the same name as the area, this naming pattern would cause a conflict. In that case, T4MVC appends &#39;Area&#39; at the end of the area name to avoid the conflict. e.g. If you have both a Home area and a Home controller (top level), you would use MVC.Home<b>Area</b>.Hello to refer to the area.<br /><br />Optionally, if you set IncludeAreasToken to true in the settings.xml file, the naming scheme becomes:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Areas.NerdDinner.Dinners.Delete(Model.DinnerID))%&gt;
</pre></div>Note that in this case, the conflict situation discussed above cannot occur. But this comes with a price as you end up with one more segment all the time. I&#39;m debating whether to even keep this mode given that the default mode works quite well.<br />
<h4>2.5.1 Alternative &quot;Feature Folder&quot; project structure</h4>
The &quot;Feature Folders&quot; convention is an alternative folder structure in which files within an area are grouped by feature (e.g. &quot;Home&quot;, &quot;Account&quot;) instead of file-type (&quot;Controllers&quot;, &quot;Views&quot;):<br />
<ul><li>Root folder
<ul><li>Areas
<ul><li>Forum
<ul><li>Posts
<ul><li>PostsController.cs</li>
<li>List.cshtml</li>
<li>Create.cshtml</li></ul></li>
<li>Categories
<ul><li>CategoriesController.cs</li>
<li>List.cshtml</li></ul></li></ul></li></ul></li></ul></li></ul>
<br />To enable this in ASP.NET MVC, you must create a custom ViewEngine that resolves the view paths correctly. Controllers aren&#39;t bound to a &quot;Controllers&quot;-folder anyway, so nothing must be changed for them. The ViewEngine could be implemented as follows:<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">public</span> <span style="color:Blue;">class</span> FeatureFolderViewEngine : RazorViewEngine
{
<span style="color:Blue;">public</span> FeatureFolderViewEngine()
{
<span style="color:Green;">// {0} ActionName; {1} ControllerName; {2} AreaName</span>
AreaViewLocationFormats = <span style="color:Blue;">new</span>[]
{
<span style="color:#A31515;">&quot;~/Areas/{2}/{1}/{0}.cshtml&quot;</span>,
<span style="color:#A31515;">&quot;~/Areas/{2}/SharedViews/{0}.cshtml&quot;</span>, <span style="color:Green;">// Replacement for &quot;Views/Shared&quot;</span>
};
AreaMasterLocationFormats = <span style="color:Blue;">new</span>[]
{
<span style="color:#A31515;">&quot;~/Areas/{2}/{1}/{0}.cshtml&quot;</span>,
<span style="color:#A31515;">&quot;~/Areas/{2}/SharedViews/{0}.cshtml&quot;</span>,
};
AreaPartialViewLocationFormats = <span style="color:Blue;">new</span>[]
{
<span style="color:#A31515;">&quot;~/Areas/{2}/{1}/{0}.cshtml&quot;</span>,
<span style="color:#A31515;">&quot;~/Areas/{2}/SharedViews/{0}.cshtml&quot;</span>,
};
<span style="color:Green;">// see System.Web.Mvc.RazorViewEngine for default settings if you want to have Controllers/Views in the root of your project</span>
ViewLocationFormats = <span style="color:Blue;">new</span>[] { ... };
MasterLocationFormats = <span style="color:Blue;">new</span>[] { ... };
PartialViewLocationFormats = <span style="color:Blue;">new</span>[] { ... };
FileExtensions = <span style="color:Blue;">new</span>[] { <span style="color:#A31515;">&quot;cshtml&quot;</span> };
}
}
</pre></div><br />Starting with version 3.9.0, T4MVC supports this structure with the optional settings parameter <b>FeatureFolderAreas</b>. <br /><br />If every area in your project follows this convention, you can set it to &quot;*&quot;:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">FeatureFolderAreas</span><span style="color:Blue;">&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">Area</span><span style="color:Blue;">&gt;</span>*<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">Area</span><span style="color:Blue;">&gt;</span>
<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">FeatureFolderAreas</span><span style="color:Blue;">&gt;</span>
</pre></div><br />If only certain areas follow this convention, you can specify them with separate Area-tags:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">FeatureFolderAreas</span><span style="color:Blue;">&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">Area</span><span style="color:Blue;">&gt;</span>Forum<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">Area</span><span style="color:Blue;">&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">Area</span><span style="color:Blue;">&gt;</span>Wiki<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">Area</span><span style="color:Blue;">&gt;</span>
<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">FeatureFolderAreas</span><span style="color:Blue;">&gt;</span>
</pre></div><br />Since T4MVC by default creates entries for every file within a Views-folder you have to exclude &quot;.cs&quot;-files. Otherwise you would also get a &quot;Views&quot;-entry for your controller or other classes within the folder. This file extension has been added to the settings file in v3.9.0! If it&#39;s not present in your project, you can add it as follows:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">ExcludedViewExtensions</span><span style="color:Blue;">&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">Extension</span><span style="color:Blue;">&gt;</span>.cs<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">Extension</span><span style="color:Blue;">&gt;</span>
<span style="color:Green;">&lt;!-- ... --&gt;</span>
<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">ExcludedViewExtensions</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h3>2.6 Using T4MVC with AsyncController</h3>
<h4>2.6.1 Enable Asynchronous Action Support</h4>
To enable support for using asynchronous actions in T4MVC you first need to change the SupportAsyncActions setting to true. This is setting is false by default since Async action calls are handled a little differently than normal action calls.<br />
<h4>2.6.1 What it does</h4>
When enabled any AsyncController with an <b>Async action will have two new methods generated in it. The first method is the standard Parameterless Overload and the second one one with the same signature as the </b>Async method but with out the Async extension. In addition, this method returns the standard ActionResult regarless of the possible return types of the *Completed methods. <br /><br />For example the following action in your controller<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">public</span> <span style="color:Blue;">void</span> IndexAsync(<span style="color:Blue;">long</span> id)
{
...
}
<span style="color:Blue;">public</span> JsonResult IndexCompleted(Models.SomeModel model)
{
<span style="color:Blue;">return</span> <span style="color:Blue;">this</span>.JSON(model);
}
</pre></div><br />would cause the following code to be generated by T4MVC<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">public</span> <span style="color:Blue;">virtual</span> ActionResult Index()
{
...
}
<span style="color:Blue;">public</span> <span style="color:Blue;">virtual</span> ActionResult Index(<span style="color:Blue;">long</span> id)
{
...
}
</pre></div><br />With this additional code you can use MVC.Controller.Action() to generate links, regardless if the action<br />is Async or not, however, you cannot mix and match with the same method names, all must be either Async or not. <br />
<h2>3. Tweaking the behavior of T4MVC</h2>
When you download T4MVC, you not only get the main T4MVC.tt template, but you also get a file named T4MVC.tt.hooks.t4, which can conatin some extensibility hooks. In addition to that, T4MVC supports a T4MVC.tt.settings.xml. This file will be created with some defaults the first time T4MVC gets to run. This file contains various knobs that you can use to tweak the code generated by T4MVC. This section describes the various switches:<br />
<h3>3.1 Using Model &#39;unbinders&#39;</h3>
By default T4MVC basically performs a .ToString() operation when adding objects to URLs (route values). It works great for value types and strings, but usually fails at complex objects. Model unbinders let you inject your custom logic into the process of serializing model to URL parameters. Say, you have the following action:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">public</span> ActionResult Profile(User user) {}
<span style="color:Blue;">public</span> <span style="color:Blue;">class</span> User {
<span style="color:Blue;">public</span> <span style="color:Blue;">int</span> Id { <span style="color:Blue;">get</span>; <span style="color:Blue;">set</span>; }
<span style="color:Blue;">public</span> <span style="color:Blue;">string</span> Login { <span style="color:Blue;">get</span>; <span style="color:Blue;">set</span>; }
}
</pre></div>Here&#39;s the typical result of generating an URL for that action with T4MVC:<br /><div style="color:Black;background-color:White;"><pre>
@Url.Action(MVC.Home.Profile(<span style="color:Blue;">new</span> User {Id = 1})); <span style="color:Green;">// -&gt; /Home/Profile?user=Mvc.HomeController.User</span>
</pre></div>If you&#39;d like to get an URL like /Home/Profile?user=1 you could write a model unbinder, which should implement either IModelUnbinder or IModelUnbinder&lt;T&gt;:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">public</span> <span style="color:Blue;">class</span> UserUnbinder : IModelUnbinder&lt;User&gt;
{
<span style="color:Blue;">public</span> <span style="color:Blue;">void</span> UnbindModel(RouteValueDictionary routeValueDictionary, <span style="color:Blue;">string</span> routeName, User user)
{
<span style="color:Blue;">if</span> (user != <span style="color:Blue;">null</span>)
routeValueDictionary.Add(routeName, user.Id);
}
}
</pre></div>and then inject it to T4MVC in Application_Start: <br /><div style="color:Black;background-color:White;"><pre>
ModelUnbinderHelpers.ModelUnbinders.Add(<span style="color:Blue;">new</span> UserUnbinder());
</pre></div>After that you&#39;ll get exactly what described above:<br /><div style="color:Black;background-color:White;"><pre>
@Url.Action(MVC.Home.Profile(<span style="color:Blue;">new</span> User {Id = 1})); <span style="color:Green;">// -&gt; /Home/Profile?user=1</span>
</pre></div>If you want T4MVC to serialize all the properties of the certain type to url parameters, built-in PropertiesUnbinder could help you do this:<br /><div style="color:Black;background-color:White;"><pre>
ModelUnbinderHelpers.ModelUnbinders.Add(<span style="color:Blue;">typeof</span>(User), <span style="color:Blue;">new</span> PropertiesUnbinder());
</pre></div>In this case you&#39;ll get:<br /><div style="color:Black;background-color:White;"><pre>
@Url.Action(MVC.Home.Profile(<span style="color:Blue;">new</span> User {Id = 1, Login = <span style="color:#A31515;">&quot;test&quot;</span> })); <span style="color:Green;">// -&gt; /Home/Profile?user.Id=1&amp;user.Login=test</span>
</pre></div>which will gently suit the default MVC model binder. T4MVC searches for unbinders through the base types and interfaces that the object implements.<br />
<h3>3.2 XML Settings File</h3>
The T4MVC.tt.settings.t4 file have been replaced with a more &quot;upgrade friendly&quot; XML configuration file. This file is automatically generated/updated by the template when it is run, so the file will always reflect the current options and settings for the template. This new structure means that future upgrade to the template will not cause manual merging of your settings into a new settings, or for the template to break because a new setting was added. Your modified existing T4MVC.tt.settings.t4 will be left behind after upgrade and will not longer be used, however, the template cannot import your settings so you will have to edit the new XML file and copy them over. Once done you can safely delete the settings.t4 file.<br /><br />Two methods from the old settings file were moved into a new T4MVC.tt.hooks.t4 file, AddTimestampToStaticLink and RenderAdditionalCode. Neither of these tweaks could be properly represented in an XML file since they are adjustments to the template its self. Changes to this file should be rare and documented when done, so during upgrades you can generally ignore replacement errors if you have customized its contents.<br />
<h3>3.3 Miscellaneous tweaks</h3>
<h4>Set SplitIntoMultipleFiles to false to generate a single file with everything</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!-- If true,the template output will be split into multiple files. --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">SplitIntoMultipleFiles</span><span style="color:Blue;">&gt;</span>true<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">SplitIntoMultipleFiles</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Use HelpersPrefix to change the MVC prefix of the generated classes</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!-- The prefix used for things like MVC.Dinners.Name and MVC.Dinners.Delete(Model.DinnerID) --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">HelpersPrefix</span><span style="color:Blue;">&gt;</span>MVC<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">HelpersPrefix</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Use ControllersFolder and ViewsRootFolder to rename the Controllers and Views folders</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!-- The folder under the project that contains the controllers --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">ControllersFolder</span><span style="color:Blue;">&gt;</span>Controllers<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">ControllersFolder</span><span style="color:Blue;">&gt;</span>
<span style="color:Green;">&lt;!-- The folder under the project that contains the views --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">ViewsRootFolder</span><span style="color:Blue;">&gt;</span>Views<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">ViewsRootFolder</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Use LinksNamespace the generated links&#39; namespace</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!-- The namespace that the links are generated in (e.g. &quot;Links&quot;, as in Links.Content.nerd_jpg) --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">LinksNamespace</span><span style="color:Blue;">&gt;</span>Links<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">LinksNamespace</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Use StaticFilesFolders to tweak the list of folders from which links are generated</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!-- Folders containing static files for which links are generated (e.g. Links.Scripts.Map_js) --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">StaticFilesFolders</span><span style="color:Blue;">&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">FileFolder</span><span style="color:Blue;">&gt;</span>Scripts<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">FileFolder</span><span style="color:Blue;">&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">FileFolder</span><span style="color:Blue;">&gt;</span>Content<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">FileFolder</span><span style="color:Blue;">&gt;</span>
<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">StaticFilesFolders</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Use GenerateParamsAsConstantsForActionMethods to generate constants instead of static classes for parameter names. This lets you use them in attributes.</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!--The true the parameter name class will be generated as constants (allowing use in attributes). This is the suggested way to do this. However, if you used T4MVC Params before and referenced them outside the controller, your references will need to change from MVC.User.MyActionParams to MVC.UserController.MyActionParams. --&gt;</span> <span style="color:Blue;">&lt;</span><span style="color:#A31515;">GenerateParamsAsConstantsForActionMethods</span><span style="color:Blue;">&gt;</span>True<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">GenerateParamsAsConstantsForActionMethods</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Customize Action values</h4>
The generated T4MVC_<a href="https://t4mvc.codeplex.com/wikipage?title=ControllerClass&referringTitle=Documentation">ControllerClass</a> classes are now partial classes so you can extend and customize the values returned from MVC.Controller.Action() calls. In this class, for each overridden method a partial method call is available, if you implement that partial you have the ability to modify the the action values before they are returned.<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">partial</span> T4MVC_SomeController
{
<span style="color:Blue;">partial</span> <span style="color:Blue;">void</span> SomeAction(T4MVC_System_Web_Mvc_ActionResult callInfo)
{
callInfo.RouteValues[<span style="color:#A31515;">&quot;other&quot;</span>] = 1;
}
}
</pre></div><br />Also, the parameterless methods are not virtual so they can be overridden in the partial as well.<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">partial</span> T4MVC_SomeController
{
<span style="color:Blue;">public</span> <span style="color:Blue;">override</span> ActionResult SomeAction()
{
<span style="color:Blue;">var</span> callInfo = <span style="color:Blue;">base</span>.SomeAction();
callInfo.GetRouteValueDictionary()[<span style="color:#A31515;">&quot;other&quot;</span>] = 1;
<span style="color:Blue;">return</span> callInfo;
}
}
</pre></div>
<h2>4. Related resources</h2>
David Ebbo has written a series of <a href="http://blogs.msdn.com/davidebb/archive/tags/T4MVC/default.aspx">blog posts on T4MVC</a><br />Scott Hanselman also <a href="http://www.hanselman.com/blog/TheWeeklySourceCode43ASPNETMVCAndT4AndNerdDinner.aspx">blogged about it here</a></div><div class="ClearBoth"></div>davidebboThu, 18 Sep 2014 18:55:15 GMTUpdated Wiki: Documentation 20140918065515PUpdated Wiki: T4MVC_Historyhttps://t4mvc.codeplex.com/wikipage?title=T4MVC_History&version=36<div class="wikidoc"><h1>T4MVC change history</h1>
<h3>3.9.1 (4-1-2014)</h3>
<ul><li>It&#39;s now possible to specify a folder from the project root that follows the &quot;FeatureFolder&quot;-convention (Settings-value: &quot;FeatureFolderRootArea&quot;).</li></ul>
<h3>3.9.0 (3-27-2014)</h3>
<ul><li>Added support for &quot;FeatureFolder&quot;-Convention where controllers and views are placed within one folder instead of separate ones. <a href="http://t4mvc.codeplex.com/discussions/479224">http://t4mvc.codeplex.com/discussions/479224</a></li></ul>
<h3>3.8.2 (3-10-2014)</h3>
<ul><li>Fix issue with linked files. <a href="https://t4mvc.codeplex.com/workitem/41">https://t4mvc.codeplex.com/workitem/41</a></li></ul>
<h3>3.8.1 (3-6-2014)</h3>
<ul><li>Improve support for Typescript files. <a href="https://t4mvc.codeplex.com/workitem/34">https://t4mvc.codeplex.com/workitem/34</a></li></ul>
<h3>3.8.0 (3-2-2014)</h3>
<ul><li>Add RedirectToAction overload that takes Task&lt;ActionResult&gt;. <a href="https://t4mvc.codeplex.com/discussions/535761">https://t4mvc.codeplex.com/discussions/535761</a></li>
<li>Fix JavaScriptReplacableUrl to correctly use ~/. <a href="https://t4mvc.codeplex.com/discussions/405911">https://t4mvc.codeplex.com/discussions/405911</a></li>
<li>Rename JavaScriptReplacableUrl to JavaScriptReplaceableUrl. I know, small breaking change, but not widely used. Live with it!</li></ul>
<h3>3.7.7 (2-23-2014)</h3>
<ul><li>Fix signing issue in 3.7.6. <a href="https://t4mvc.codeplex.com/discussions/533445">https://t4mvc.codeplex.com/discussions/533445</a></li></ul>
<h3>3.7.6 (2-20-2014)</h3>
<ul><li>Allow AddRouteValues to override values. <a href="https://t4mvc.codeplex.com/workitem/39">https://t4mvc.codeplex.com/workitem/39</a></li></ul>
<h3>3.7.5 (1-28-2014)</h3>
<ul><li>Make statuc MVC class partial. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/garyhunt/T4MVCpartial/contribution/6116">https://t4mvc.codeplex.com/SourceControl/network/forks/garyhunt/T4MVCpartial/contribution/6116</a></li>
<li>Mark action overloads as NonAction. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/garyhunt/T4MVCNonAction/contribution/6118">https://t4mvc.codeplex.com/SourceControl/network/forks/garyhunt/T4MVCNonAction/contribution/6118</a></li></ul>
<h3>3.7.4 (9-19-2013)</h3>
<ul><li>Set buildaction of t4 files to none. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/duncans/T4MVC/contribution/5356">https://t4mvc.codeplex.com/SourceControl/network/forks/duncans/T4MVC/contribution/5356</a></li></ul>
<h3>3.7.3 (8-09-2013)</h3>
<ul><li>Fix issue 23 - support for &#39;async Task&lt;ActionResult&gt;&#39; methods. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/5154">https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/5154</a></li></ul>
<h3>3.7.2 (8-07-2013)</h3>
<ul><li>Fix abstract view result method generation. <a href="https://t4mvc.codeplex.com/workitem/23">https://t4mvc.codeplex.com/workitem/23</a></li></ul>
<h3>3.7.1 (7-05-2013)</h3>
<ul><li>Fixed bug where AddRouteValue() throws ArgumentException if route value has already been added. <a href="https://t4mvc.codeplex.com/workitem/25">https://t4mvc.codeplex.com/workitem/25</a></li></ul>
<h3>3.7.0 (6-16-2013)</h3>
<ul><li>New AddAllViewsFoldersToStaticFilesFolders flag to include view folder files as static files (off by default) <a href="https://t4mvc.codeplex.com/discussions/445358">https://t4mvc.codeplex.com/discussions/445358</a></li>
<li>New ExcludedViewExtensions setting to not treat certain file extensions as views</li></ul>
<h3>3.6.5 (5-19-2013)</h3>
<ul><li>Use Controller constructor with least number of params. <a href="https://t4mvc.codeplex.com/workitem/22">https://t4mvc.codeplex.com/workitem/22</a></li></ul>
<h3>3.6.4 (5-08-2013)</h3>
<ul><li>Added support for checking files out with Perforce P4VS. <a href="https://t4mvc.codeplex.com/discussions/442992">https://t4mvc.codeplex.com/discussions/442992</a></li></ul>
<h3>3.6.3 (5-08-2013)</h3>
<ul><li>Fix assembly signing</li></ul>
<h3>3.6.2 (5-07-2013)</h3>
<ul><li>Avoid identifier conflict when content file names are similar. <a href="https://t4mvc.codeplex.com/discussions/441214">https://t4mvc.codeplex.com/discussions/441214</a></li></ul>
<h3>3.6.1 (5-03-2013)</h3>
<ul><li>Make actionresult classes partial. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/duncans/T4MVC/contribution/4632">https://t4mvc.codeplex.com/SourceControl/network/forks/duncans/T4MVC/contribution/4632</a></li></ul>
<h3>3.6.0 (4-26-2013)</h3>
<ul><li>Add support for task based actions. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/kev_bite/T4mvcTaskBasedActions/contribution/4564">https://t4mvc.codeplex.com/SourceControl/network/forks/kev_bite/T4mvcTaskBasedActions/contribution/4564</a></li></ul>
<h3>3.5.4 (4-22-2013)</h3>
<ul><li>Make action results internal to avoid cross project conflicts</li></ul>
<h3>3.5.3 (4-19-2013):</h3>
<ul><li>Add support for portable areas without a standard area folder</li></ul>
<h3>3.5.2 (3-07-2013):</h3>
<ul><li>Add support for inherited controller attributes. <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/4194">http://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/4194</a></li></ul>
<h3>3.5.1 (2-25-2013):</h3>
<ul><li>If static files include a timestamp, previously for minified CSS- and JavaScript-files the timestamp was generated by taking the last change time of the unminified file. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4122">https://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4122</a></li></ul>
<h3>3.5.0 (2-08-2013):</h3>
<ul><li>Sign T4MVCExtensions.dll <a href="http://t4mvc.codeplex.com/discussions/432534">http://t4mvc.codeplex.com/discussions/432534</a></li>
<li>Call T4Extension.TimestampString through delegate for unit testing <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4040">http://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4040</a></li></ul>
<h3>3.4.1 (1-31-2013):</h3>
<ul><li>Make T4MVCHelpers internal to avoid cross project conflicts <a href="http://t4mvc.codeplex.com/workitem/17">http://t4mvc.codeplex.com/workitem/17</a></li></ul>
<h3>3.4.0 (1-23-2013):</h3>
<ul><li>Add optional support for async methods <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/3958">https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/3958</a></li>
<li>Generate partial methods to allow custom &quot;overloading&quot; of the return values.</li></ul>
<h3>3.3.0 (1-16-2013):</h3>
<ul><li> Add support for support for model unbinder providers <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/Augi/T4MVCUnbinderProvider/contribution/3879">https://t4mvc.codeplex.com/SourceControl/network/forks/Augi/T4MVCUnbinderProvider/contribution/3879</a></li>
<li> Fix handling of &quot;completed&quot; methods <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/phw/t4mvc/contribution/3922">https://t4mvc.codeplex.com/SourceControl/network/forks/phw/t4mvc/contribution/3922</a></li></ul>
<h3>3.2.1 (12-27-2012):</h3>
<ul><li> Fix issue with VB projects causing exceptions <a href="http://t4mvc.codeplex.com/workitem/7">http://t4mvc.codeplex.com/workitem/7</a></li></ul>
<h3>3.2.0 (12-11-2012):</h3>
<ul><li> Add option to make parameter names constants <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/WayneBrantley/ParameterNamesToConst/contribution/3762">https://t4mvc.codeplex.com/SourceControl/network/forks/WayneBrantley/ParameterNamesToConst/contribution/3762</a></li></ul>
<h3>3.1.0 (12-09-2012):</h3>
<ul><li>Added JavaScriptReplacableUrl helper <a href="http://t4mvc.codeplex.com/discussions/405911">http://t4mvc.codeplex.com/discussions/405911</a></li></ul>
<h3>3.0.3 (11-30-2012):</h3>
<ul><li>Fix to deal with multiple attributes <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/ArtiomChi/t4mvc/contribution/3723">http://t4mvc.codeplex.com/SourceControl/network/forks/ArtiomChi/t4mvc/contribution/3723</a></li></ul>
<h3>3.0.2 (11-17-2012):</h3>
<ul><li>Add support for generic result types <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/ryanrust/T4MVC/contribution/3653">http://t4mvc.codeplex.com/SourceControl/network/forks/ryanrust/T4MVC/contribution/3653</a></li></ul>
<h3>3.0.1 (11-16-2012):</h3>
<ul><li>Fix T4MVC.tt.settings.xml so it only gets generated when needed <a href="https://t4mvc.codeplex.com/discussions/403390">https://t4mvc.codeplex.com/discussions/403390</a></li></ul>
<h3>3.0.0 (11-14-2012):</h3>
<ul><li>Move all the non-dynamic code to a separate T4MVCExtensions.dll assembly</li>
<li>Change generated code brace style to Allman</li>
<li>Added many new RouteLink/BeginRouteForm/RouteUrl helpers</li></ul>
<h3>2.13.0 (10-24-2012):</h3>
<ul><li>Move settings to T4MVC.tt.settings.xml XML file instead of tt file. See doc for details.</li>
<li>Make simple view names available alongside full names, e.g. MVC.Home.Views.SomeView vs MVC.Home.Views.ViewNames.SomeView</li></ul>
<h3>2.12.0 (10-16-2012):</h3>
<ul><li>Add support for static files in nested folders <a href="http://t4mvc.codeplex.com/workitem/6">http://t4mvc.codeplex.com/workitem/6</a></li>
<li>Add MVC 4 bundle starter classes <a href="https://t4mvc.codeplex.com/discussions/399205">https://t4mvc.codeplex.com/discussions/399205</a></li></ul>
<h3>2.11.2 (10-11-2012):</h3>
<ul><li>Removed optional params in ActionLink to support expression trees <a href="http://t4mvc.codeplex.com/workitem/4">http://t4mvc.codeplex.com/workitem/4</a></li>
<li>Change brace style of generated code to Allman</li></ul>
<h3>2.11.1 (10-10-2012):</h3>
<ul><li>Ignore methods that return generic types <a href="http://mvccontrib.codeplex.com/workitem/7178">http://mvccontrib.codeplex.com/workitem/7178</a></li></ul>
<h3>2.11.0 (10-09-2012):</h3>
<ul><li>Corrects the ActionParameters class for overloaded actions to list all parameters and not just the parameters from the first action found.</li></ul>
<h3>2.10.4 (10-05-2012):</h3>
<ul><li>Added attributes so it builds clean under Code Analysis <a href="http://t4mvc.codeplex.com/workitem/10">http://t4mvc.codeplex.com/workitem/10</a></li></ul>
<h3>2.10.3 (09-30-2012):</h3>
<ul><li>Fix crash when querystring contains a null key <a href="http://t4mvc.codeplex.com/discussions/396916">http://t4mvc.codeplex.com/discussions/396916</a></li></ul>
<h3>2.10.2 (09-17-2012):</h3>
<ul><li>Fix UnbindModel to avoid failing on duplicate entries <a href="http://t4mvc.codeplex.com/discussions/394529">http://t4mvc.codeplex.com/discussions/394529</a></li>
<li>Fix ModelUnbinder code generation when SplitIntoMultipleFiles is false <a href="http://t4mvc.codeplex.com/workitem/9">http://t4mvc.codeplex.com/workitem/9</a></li></ul>
<h3>2.10.1 (07-31-2012):</h3>
<ul><li>Fixed default param regression with model unbinder code (<a href="http://stackoverflow.com/questions/11566207/t4mvc-optionalparameter-values-implied-from-current-context/11603897">http://stackoverflow.com/questions/11566207/t4mvc-optionalparameter-values-implied-from-current-context/11603897</a>)</li></ul>
<h3>2.10.0 (07-03-2012):</h3>
<ul><li>Added support for custom model binders (<a href="https://t4mvc.codeplex.com/discussions/357386">https://t4mvc.codeplex.com/discussions/357386</a>)</li>
<li>Fixed unreachable code warning</li></ul>
<h3>2.9.0 (06-22-2012):</h3>
<ul><li>Added support for minified css files (<a href="https://t4mvc.codeplex.com/discussions/360443">https://t4mvc.codeplex.com/discussions/360443</a>)</li>
<li>Replaced improper new RouteValueDictionary usage on htmlAttributes</li></ul>
<h3>2.8.1 (04-12-2012):</h3>
<ul><li>Also default to https for the default (no param) action overload</li>
<li>Make T4MVCHelpers class public so that test code in a different assembly can access it</li></ul>
<h3>2.8 (03-25-2012):</h3>
<ul><li>Generate parameter constants for action methods. e.g. MVC.MyController.MethodParams.someParam</li>
<li>Default to https for Action Methods marked as RequireHttps (either at controller or action level)</li></ul>
<h3>2.7.0 (03-09-2012):</h3>
<ul><li>Removed support for MVC earlier than 3, and for CLR earlier than 4.0</li>
<li>Fix ActionLink to work with MVC4 (<a href="http://mvccontrib.codeplex.com/workitem/7191">http://mvccontrib.codeplex.com/workitem/7191</a>)</li></ul>
<h3>2.6.68 (02-03-2012):</h3>
<ul><li>Ignore static ctors when looking for ctors (<a href="http://mvccontrib.codeplex.com/workitem/7185">http://mvccontrib.codeplex.com/workitem/7185</a>)</li></ul>
<h3>2.6.67 (12-24-2011):</h3>
<ul><li>Restore Actions token that wasn&#39;t obsolete after all. Oops. (<a href="http://stackoverflow.com/questions/8625462/t4mvc-actions-token">http://stackoverflow.com/questions/8625462/t4mvc-actions-token</a>)</li></ul>
<h3>2.6.66 (12-22-2011):</h3>
<ul><li>Disable constant generation in UseLowercaseRoutes mode (<a href="http://stackoverflow.com/questions/8605868/t4mvc-2-6-65-and-uselowercaseroutes-true-error">http://stackoverflow.com/questions/8605868/t4mvc-2-6-65-and-uselowercaseroutes-true-error</a>)</li>
<li>Remove obsolete Actions token (<a href="http://stackoverflow.com/questions/8536269/what-is-the-difference-between-these-2-definitions-in-t4mvc/8543510">http://stackoverflow.com/questions/8536269/what-is-the-difference-between-these-2-definitions-in-t4mvc/8543510</a>)</li></ul>
<h3>2.6.65 (12-06-2011):</h3>
<ul><li>Add true constant strings for use in attributes (<a href="http://mvccontrib.codeplex.com/workitem/7177">http://mvccontrib.codeplex.com/workitem/7177</a>)</li></ul>
<h3>2.6.64 (10-21-2011):</h3>
<ul><li>Fix issue when action parameter name is escaped using @ syntax (e.g. int @event)</li></ul>
<h3>2.6.63 (10-13-2011):</h3>
<ul><li>Move hard coded T4MVC namespace into settings file</li></ul>
<h3>2.6.62 (08-13-2011):</h3>
<ul><li>Replace some unwanted tab characters with whitespace</li></ul>
<h3>2.6.61 (08-01-2011):</h3>
<ul><li>Ignore generic action methods (<a href="http://mvccontrib.codeplex.com/workitem/7156">http://mvccontrib.codeplex.com/workitem/7156</a>)</li></ul>
<h3>2.6.60 (07-28-2011):</h3>
<ul><li>Added support for portable areas. Enabled by adding area names to PortableAreas in T4MVC.tt.settings.t4</li>
<li>When generating links and views, if the folder name is the same as the parent, add a modifier to avoid class name conflicts (<a href="http://mvccontrib.codeplex.com/workitem/7153">http://mvccontrib.codeplex.com/workitem/7153</a>)</li></ul>
<h3>2.6.59 (07-12-2011):</h3>
<ul><li>Added commented out logic to show how to debug into the template (<a href="http://mvccontrib.codeplex.com/workitem/7144">http://mvccontrib.codeplex.com/workitem/7144</a>)</li>
<li>Ignore any class which name doesn&#39;t end with &quot;Controller&quot;</li></ul>
<h3>2.6.58 (06-24-2011):</h3>
<ul><li>Change the controller detection logic to be more reliable and ignore anything that doesn&#39;t extend Controller.</li></ul>
<h3>2.6.57 (06-21-2011):</h3>
<ul><li>Re-added Html.ActionLink/Url.Action overload without default params to avoid running into &quot;CS0854: An expression tree may not contain a call or invocation that uses optional arguments&quot;</li>
<li>Make ProcessControllerActionMethods look for ControllerBase instead of Controller to support controllers like MailerBase (from ActionMailer) which extend ControllerBase.</li></ul>
<h3>2.6.56 (06-05-2011):</h3>
<ul><li>Added optional Html.ActionLink parameters for protocol, hostname and fragment (<a href="http://stackoverflow.com/questions/6280347/how-can-i-add-a-hash-fragment-to-t4mvc-route-dictionary-actionresult/6302703">http://stackoverflow.com/questions/6280347/how-can-i-add-a-hash-fragment-to-t4mvc-route-dictionary-actionresult/6302703</a>)</li></ul>
<h3>2.6.55 (06-05-2011):</h3>
<ul><li>Added optional Url.Action parameters for protocol and hostname (<a href="http://stackoverflow.com/questions/6240568/t4mvc-doesnt-work-property-with-url-action">http://stackoverflow.com/questions/6240568/t4mvc-doesnt-work-property-with-url-action</a>)</li></ul>
<h3>2.6.54 (04-23-2011):</h3>
<ul><li>Added missing license to NuGet package and fixed some links. No actual template changes!</li></ul>
<h3>2.6.53 (04-18-2011):</h3>
<ul><li>Ignore actions marked as obsolete (<a href="http://mvccontrib.codeplex.com/workitem/7133">http://mvccontrib.codeplex.com/workitem/7133</a>)</li></ul>
<h3>2.6.52 (04-14-2011):</h3>
<ul><li>Moved the &#39;Dummy&#39; class under the GenerateMvcT4Extensions check</li>
<li>Always include the area token in the route values unless running on MVC 1.x</li></ul>
<h3>2.6.51 (04-12-2011):</h3>
<ul><li>Ignore async completion methods as they can&#39;t really be used in T4MVC, and can cause issues (<a href="http://stackoverflow.com/questions/5419173/t4mvc-asynccontroller">http://stackoverflow.com/questions/5419173/t4mvc-asynccontroller</a>)</li></ul>
<h3>2.6.50 (04-08-2011):</h3>
<ul><li>Added AddTimestampToStaticLink() method to settings file to allow more granular decision (per <a href="http://mvccontrib.codeplex.com/workitem/7129">this post</a>)</li>
<li>Added GenerateMvcT4Extensions settings flag to omit the generation of the System.Web.Mvc.T4Extensions class, which can be useful if it is already defined in a referenced library (see <a href="http://stackoverflow.com/questions/5563163/t4mvc-use-extension-methods-in-control-library/5574227">this post</a>)</li></ul>
<h3>2.6.44 (03-10-2011):</h3>
<ul><li>Added UseNonQualifiedViewNames flag which when set to true causes view names never to be fully qualified. Spark users may need that.</li></ul>
<h3>2.6.43 (02-24-2011):</h3>
<ul><li>Renamed T4MVC.settings.t4 to T4MVC.tt.settings.t4 so it feels more like a &#39;child&#39; file of T4MVC.tt</li></ul>
<h3>2.6.42 (02-01-2011):</h3>
<ul><li>Fix partial view support for MVC</li>
<li>Fix partial view support when name has periods (<a href="http://mvccontrib.codeplex.com/workitem/7113">http://mvccontrib.codeplex.com/workitem/7113</a>)</li></ul>
<h3>2.6.41 (01-17-2011):</h3>
<ul><li>Added AJAX BeginForm overloads</li></ul>
<h3>2.6.40 (01-05-2011):</h3>
<ul><li>Added BeginForm overload that just takes an ActionResult</li>
<li>Fix MapRouteArea to use UseNamespaceFallback when there are no namespaces</li></ul>
<h3>2.6.32 (12-15-2010):</h3>
<ul><li>Fix bug in controller name generation when IncludeAreasToken is true</li></ul>
<h3>2.6.31 (11-15-2010):</h3>
<ul><li>Improve error message when T4MVC generated files are out of date.</li>
<li>Changed some &#39;const bool&#39; settings to &#39;static bool&#39; to avoid unused code warnings.</li>
<li>Disabled regen optimization added in 2.6.14 since it doesn&#39;t catch view changes</li></ul>
<h3>2.6.30 (09-05-2010):</h3>
<ul><li>Changed ExplicitHtmlHelpersForPartials flag to be off by default (and fix a small issue when it&#39;s off)</li>
<li>Handled System.NotImplementedException if project type (e.g. Installer) does not implement CodeModel property</li>
<li>Fixed issue when action method params are all optional (<a href="http://stackoverflow.com/questions/3488610/t4mvc-and-named-parameters">http://stackoverflow.com/questions/3488610/t4mvc-and-named-parameters</a>)</li>
<li>Exclude Area related methods when using MVC 1.0, as that was breaking things</li>
<li>Added logic to special case DisplayTemplates/EditorTemplates folders, since they need short view names passed in</li></ul>
<h3>2.6.21 (07-20-2010):</h3>
<ul><li>Fix to the partial extension feature added in 2.6.20 to deal with conflicts</li></ul>
<h3>2.6.20 (07-19-2010):</h3>
<ul><li>Added extension methods to render partial views (see <a href="http://www.weirdlover.com/2010/05/12/t4mvc-extension-for-mvc-partials/">this post</a>)
<ul><li>e.g. Html.RenderPartial(&quot;Map&quot;, Model.Dinner); --&gt; Html.RenderMap(Model.Dinner);</li>
<li>Can be turned off in settings file via ExplicitHtmlHelpersForPartials flag.</li></ul></li></ul>
<h3>2.6.15 (05-16-2010):</h3>
<ul><li>Added missing MapRoute overloads to support namespaces</li>
<li>Added MapRoute extensions on AreaRegistrationContext to support areas. Had to name them MapRouteArea to avoid clash with existing MapRoute methods :(</li></ul>
<h3>2.6.14 (05-06-2010):</h3>
<ul><li>Added UseLowercaseRoutes flag to lower case the area, controller and action names in routes</li>
<li>Added support for Views folders that don&#39;t match a controller name.</li>
<li>Added optimization to not regenerate files when the controller has not changed since the last generation</li>
<li>Turn AlwaysKeepTemplateDirty to false by default. We now have an <a href="http://blogs.msdn.com/davidebb/archive/2010/03/18/an-even-better-way-to-run-t4mvc-a-vs-addin.aspx">addin</a> which provides a better solution to this</li></ul>
<h3>2.6.13 (03-08-2010):</h3>
<ul><li>Added AddTimestampToStaticLinks flag to T4MVC.settings.t4 to generate static links that change when the file changes.</li>
<li>Added support for [Bind(Prefix = &quot;newParamName&quot;)] attribute so it generates the correct route value</li>
<li>Added an AddRouteValues overload that takes NameValueCollection, e.g.
<ul><li>MVC.Home.About().AddRouteValues(Request.QueryString)</li></ul></li>
<li>Added MapRoute overload that supports contraints</li>
<li>Removed some logic to support VS2010 Beta 2. VS2010 RC or later should now be used.</li></ul>
<h3>2.6.12 (01-15-2010):</h3>
<ul><li>Fixed issue where some special project types (e.g. DB projects) were throwing while enumerating over the list</li>
<li>Changed to use GeneratedCode attribute instead of the less correct CompilerGenerated</li>
<li>Fixed CompilerGenerated/DebuggerNonUserCode attributes so they don&#39;t incorrectly affect the control classes</li>
<li>Change to avoid adding area to route if the app is not using areas</li></ul>
<h3>2.6.11 (01-10-2010):</h3>
<ul><li>Added ExcludedStaticFileExtensions setting to T4MVC.settings.t4 to list extensions for which static links should not be generated.</li>
<li>Support configurable name for IT4MVCActionResult, and it being defined externally (for sharing pourpose)</li>
<li>Added DebuggerNonUserCode attribute to generated classes</li>
<li>Improved error handling when trying to call T4MVC method with real ActionResult (previous threw InvalidCast)</li>
<li>Fix issue when overridden action methods were incorrectly marked as virtual</li></ul>
<h3>2.6.10 (01-04-2010):</h3>
<ul><li>Added support for adding arbitrary route parameters to T4MVC actions. e.g.
<ul><li>MVC.Home.About().AddRouteValue(&quot;fooKey&quot;, bar.Foo.Key)</li>
<li>MVC.Home.About().AddRouteValues(new {fooKey = bar.Foo.Key, barKey = bar.Key})</li></ul></li>
<li>Added shorter to refer to controller actions from with the controller itself. e.g.
<ul><li>return RedirectToAction(MVC.MyController.Actions.About()); BECOMES:</li>
<li>return RedirectToAction(Actions.About());</li></ul></li>
<li>What was previously called Actions was renamed to ActionNames (note, that&#39;s a BREAKING CHANGE if you used Actions before!)</li>
<li>Ignore controller methods that are marked with a NonAction attribute</li>
<li>Renamed IT4MVCActionResult.RouteValues to avoid conflict (this should not break anything, as it&#39;s only used internally)</li></ul>
<h3>2.6.03 (12-10-2009):</h3>
<ul><li>Generate full view paths to allow cross controller references
<ul><li>e.g. MVC.Dinners.Views.DinnerForm is now &quot;~/Views/Dinners/DinnerForm.ascx&quot; instead of just &quot;DinnerForm&quot;</li></ul></li>
<li>Fix compile error when a view name is a language keyword (e.g. string.ascx)</li></ul>
<h3>2.6.02 (12-04-2009)</h3>
<ul><li>Added way to get area name from both Area and Controller objects
<ul><li>e.g. MVC.MyArea.Name and MVC.MyArea.MyController.Area</li></ul></li>
<li>Added support for controllers in the default namespace (i.e. no namespace)</li>
<li>Always include the area in the route data, even when it&#39;s null/empty</li></ul>
<h3>2.6.01 (12-02-2009)</h3>
<ul><li>Fix compile error when a custom ActionResult type has a ctor that takes a value type</li></ul>
<h3>2.6.00 (11-28-2009)</h3>
<ul><li>Added support for MVC 2 Areas</li>
<li>Fixed issue where non-existing RenderAction method gets generated on VS2010 Beta 2</li>
<li>Added check to give proper error when attempting to run T4MVC outside VS (e.g. from TextTransform.exe)</li></ul>
<h3>2.5.02 (11-24-2009)</h3>
<ul><li>Change links in comment to point to new T4MVC home and forum</li>
<li>Fix scenario where a View folder as a name that&#39;s a C# keyword</li></ul>
<h3>2.5.01 (11-20-2009)</h3>
<ul><li>Added support for Html.RenderAction and Html.Action (see http://haacked.com/archive/2009/11/18/aspnetmvc2-render-action.aspx)</li>
<li>Fix null ref exception issue when custom ActionResult type doesn&#39;t have any explicit ctors</li></ul>
<h3>2.5.00 (11-16-2009)</h3>
<ul><li>Incorporated Damien Guard&#39;s multiple output manager to (optionally) split output from T4MVC into separate files to improve source control</li>
<li>Added support for minified javascript files in production</li>
<li>Fixed bug occurring when no action is of type ActionResult</li></ul>
<h3>2.4.04 (10-15-2009)</h3>
<ul><li>Added support for MVC 2 by detecting the version and generating slightly different code</li></ul>
<h3>2.4.03 (10-02-2009)</h3>
<ul><li>Added ProcessVirtualPath method to T4MVC.settings.t4 so user can write custom logic to modify client URL&#39;s</li>
<li>Greatly simplified GetProjectContainingT4File logic by using FindProjectItem().</li>
<li>Renamed generated classes to be CLS compliant</li>
<li>Moved most of the doc and versioning comments from T4MVC.tt into the readme.txt file, as it was getting a bit long.</li></ul>
<h3>2.4.02 (09-02-2009)</h3>
<ul><li>Added a setting in T4MVC.settings.t4 to set the namespace that Links get generated in</li>
<li>Added pragma to prevent compiler from complaining about missing Xml comments</li>
<li>Added &lt;auto-generated /&gt; comment to disable StyleCop in generated file</li>
<li>Fixed issue when using a custom ResultType in a custom namespace. Now fully qualifying result types.</li></ul>
<h3>2.4.01 (07-29-2009):</h3>
<ul><li>Put all the generated code in a T4MVC #region. This is useful to tell tools like ReSharper to ignore it.</li>
<li>Fixed issue where controller methods returning generic types cause template to blow up</li>
<li>Added a setting in T4MVC.settings.t4 to turn off the behavior that always keeps the template dirty</li></ul>
<h3>2.4.00 (07-28-2009):</h3>
<ul><li>Added support for configurable settings in a separate T4MVC.settings.t4 file</li>
<li>Added a parameter-less pseudo-action for every action that doesn&#39;t already have a parameter-less overload</li>
<li>Added support for having T4MVC.tt in a sub folder instead of always at the root of the project</li>
<li>Fixed issue when a base controller doesn&#39;t have a default ctor</li>
<li>Added T4Extensions into System.Web.Mvc namespace to fix ambiguous resolution issue </li>
<li>Misc cleanup</li></ul>
<h3>2.3.01 (07-10-2009):</h3>
<ul><li>Fixed issue with <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName&referringTitle=T4MVC_History">ActionName</a> attribute set to non literal string values (e.g. <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName%28SomeConst%20%2b%20%22Abc%22%29&referringTitle=T4MVC_History">ActionName&#40;SomeConst &#43; &#34;Abc&#34;&#41;</a>)</li>
<li>Fixed duplication issue when partial controller classes have a base type which contains action methods</li>
<li>Skip App_LocalResources when processing views</li>
<li>Cleaned up rendering logic</li></ul>
<h3>2.3.00 (07-07-2009):</h3>
<ul><li>Added support for sub view folders</li>
<li>Added support for <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName&referringTitle=T4MVC_History">ActionName</a> attribute</li>
<li>Improved handling when the controller comes from a different project</li>
<li>Don&#39;t try to process generic controller classes</li></ul>
<h3>2.2.03 (07-06-2009):</h3>
<ul><li>Added support for action methods defined on controller base classes</li>
<li>Improved error handling when not able to change actions to virtual and controllers to partial</li></ul>
<h3>2.2.02 (07-01-2009):</h3>
<ul><li>Fixed break caused by incorrect support for derived ActionResult types in 2.2.01</li>
<li>Fixed issue with duplicate view tokens getting generated when you have both foo.aspx and foo.ascx</li></ul>
<h3>2.2.01 (07-01-2009):</h3>
<ul><li>Added support for action methods that return a type derived from ActionResult (as opposed to exactly an ActionResult)</li>
<li>Fixed issue when controller is using partial classes</li>
<li>Fixed folder handling logic to deal with generated files</li>
<li>Fixed issue with folder names that are C# keyword</li>
<li>Throw NotSupportedException instead of NotImplementedException to avoid being viewed as a TODO</li></ul>
<h3>2.2.00 (06-30-2009):</h3>
<ul><li>Added strongly typed support to MapRoute</li>
<li>Changed constructor generation to avoid confusing IoC containers</li>
<li>Fixed issue with empty Content folder</li>
<li>Fixed issue with abstract controller base classes</li></ul>
<h3>2.1.00 (06-29-2009):</h3>
<ul><li>Added Html.BeginForm overloads that use the strongly typed pattern</li>
<li>Added Url() helpers on static resources to increase flexibility</li>
<li>Changed generated constants (view and action names, static files) to be readonly strings</li>
<li>Fixed null ref exception in Solution Folder logic</li></ul>
<h3>2.0.04 (06-28-2009):</h3>
<ul><li>Fixed issue with files and folders with names starting with a digit</li></ul>
<h3>2.0.03 (06-27-2009):</h3>
<ul><li>Rework code element enumeration logic to work around a VS2010 issue. The template should now work with VS2010 beta 1!</li>
<li>Reduced some redundancy in the generated code</li></ul>
<h3>2.0.02 (06-27-2009):</h3>
<ul><li>Added ActionLink overloads that take object instead of dictionary (from both Html and Ajax)</li></ul>
<h3>2.0.01 (06-26-2009):</h3>
<ul><li>Fixed issue with files and folders with invalid identifier characters (e.g. spaces, &#39;-&#39;, &#39;.&#39;)</li></ul>
<h3>2.0.00 (06-26-2009):</h3>
<ul><li>Added support for refactoring in Action methods</li>
<li>The T4 file automatically runs whenever you build, instead of being done manually</li>
<li>Support for strongly typed links to static resources</li>
<li>Fix: supports controllers that are in sub-folders of the Controllers folder and not directly in there</li>
<li>Fix: works better with nested solution folder </li>
<li>Random other small fixes</li></ul>
<h3>1.0.xx (06-17-2009):</h3>
<ul><li>the original based on <a href="http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx">this post</a></li></ul>
</div><div class="ClearBoth"></div>davidebboMon, 28 Jul 2014 20:48:29 GMTUpdated Wiki: T4MVC_History 20140728084829PUpdated Wiki: T4MVC_Historyhttps://t4mvc.codeplex.com/wikipage?title=T4MVC_History&version=35<div class="wikidoc"><h1>T4MVC change history</h1>
<h3>3.9.2 (?-2014)</h3>
<ul><li>Remove warning about methods not returning supported types. <a href="http://stackoverflow.com/questions/3312824/how-can-you-get-t4-to-skip-transforming-for-custom-methods/3315118?noredirect=1">http://stackoverflow.com/questions/3312824/how-can-you-get-t4-to-skip-transforming-for-custom-methods/3315118?noredirect=1</a></li></ul>
<h3>3.9.1 (4-1-2014)</h3>
<ul><li>It&#39;s now possible to specify a folder from the project root that follows the &quot;FeatureFolder&quot;-convention (Settings-value: &quot;FeatureFolderRootArea&quot;).</li></ul>
<h3>3.9.0 (3-27-2014)</h3>
<ul><li>Added support for &quot;FeatureFolder&quot;-Convention where controllers and views are placed within one folder instead of separate ones. <a href="http://t4mvc.codeplex.com/discussions/479224">http://t4mvc.codeplex.com/discussions/479224</a></li></ul>
<h3>3.8.2 (3-10-2014)</h3>
<ul><li>Fix issue with linked files. <a href="https://t4mvc.codeplex.com/workitem/41">https://t4mvc.codeplex.com/workitem/41</a></li></ul>
<h3>3.8.1 (3-6-2014)</h3>
<ul><li>Improve support for Typescript files. <a href="https://t4mvc.codeplex.com/workitem/34">https://t4mvc.codeplex.com/workitem/34</a></li></ul>
<h3>3.8.0 (3-2-2014)</h3>
<ul><li>Add RedirectToAction overload that takes Task&lt;ActionResult&gt;. <a href="https://t4mvc.codeplex.com/discussions/535761">https://t4mvc.codeplex.com/discussions/535761</a></li>
<li>Fix JavaScriptReplacableUrl to correctly use ~/. <a href="https://t4mvc.codeplex.com/discussions/405911">https://t4mvc.codeplex.com/discussions/405911</a></li>
<li>Rename JavaScriptReplacableUrl to JavaScriptReplaceableUrl. I know, small breaking change, but not widely used. Live with it!</li></ul>
<h3>3.7.7 (2-23-2014)</h3>
<ul><li>Fix signing issue in 3.7.6. <a href="https://t4mvc.codeplex.com/discussions/533445">https://t4mvc.codeplex.com/discussions/533445</a></li></ul>
<h3>3.7.6 (2-20-2014)</h3>
<ul><li>Allow AddRouteValues to override values. <a href="https://t4mvc.codeplex.com/workitem/39">https://t4mvc.codeplex.com/workitem/39</a></li></ul>
<h3>3.7.5 (1-28-2014)</h3>
<ul><li>Make statuc MVC class partial. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/garyhunt/T4MVCpartial/contribution/6116">https://t4mvc.codeplex.com/SourceControl/network/forks/garyhunt/T4MVCpartial/contribution/6116</a></li>
<li>Mark action overloads as NonAction. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/garyhunt/T4MVCNonAction/contribution/6118">https://t4mvc.codeplex.com/SourceControl/network/forks/garyhunt/T4MVCNonAction/contribution/6118</a></li></ul>
<h3>3.7.4 (9-19-2013)</h3>
<ul><li>Set buildaction of t4 files to none. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/duncans/T4MVC/contribution/5356">https://t4mvc.codeplex.com/SourceControl/network/forks/duncans/T4MVC/contribution/5356</a></li></ul>
<h3>3.7.3 (8-09-2013)</h3>
<ul><li>Fix issue 23 - support for &#39;async Task&lt;ActionResult&gt;&#39; methods. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/5154">https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/5154</a></li></ul>
<h3>3.7.2 (8-07-2013)</h3>
<ul><li>Fix abstract view result method generation. <a href="https://t4mvc.codeplex.com/workitem/23">https://t4mvc.codeplex.com/workitem/23</a></li></ul>
<h3>3.7.1 (7-05-2013)</h3>
<ul><li>Fixed bug where AddRouteValue() throws ArgumentException if route value has already been added. <a href="https://t4mvc.codeplex.com/workitem/25">https://t4mvc.codeplex.com/workitem/25</a></li></ul>
<h3>3.7.0 (6-16-2013)</h3>
<ul><li>New AddAllViewsFoldersToStaticFilesFolders flag to include view folder files as static files (off by default) <a href="https://t4mvc.codeplex.com/discussions/445358">https://t4mvc.codeplex.com/discussions/445358</a></li>
<li>New ExcludedViewExtensions setting to not treat certain file extensions as views</li></ul>
<h3>3.6.5 (5-19-2013)</h3>
<ul><li>Use Controller constructor with least number of params. <a href="https://t4mvc.codeplex.com/workitem/22">https://t4mvc.codeplex.com/workitem/22</a></li></ul>
<h3>3.6.4 (5-08-2013)</h3>
<ul><li>Added support for checking files out with Perforce P4VS. <a href="https://t4mvc.codeplex.com/discussions/442992">https://t4mvc.codeplex.com/discussions/442992</a></li></ul>
<h3>3.6.3 (5-08-2013)</h3>
<ul><li>Fix assembly signing</li></ul>
<h3>3.6.2 (5-07-2013)</h3>
<ul><li>Avoid identifier conflict when content file names are similar. <a href="https://t4mvc.codeplex.com/discussions/441214">https://t4mvc.codeplex.com/discussions/441214</a></li></ul>
<h3>3.6.1 (5-03-2013)</h3>
<ul><li>Make actionresult classes partial. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/duncans/T4MVC/contribution/4632">https://t4mvc.codeplex.com/SourceControl/network/forks/duncans/T4MVC/contribution/4632</a></li></ul>
<h3>3.6.0 (4-26-2013)</h3>
<ul><li>Add support for task based actions. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/kev_bite/T4mvcTaskBasedActions/contribution/4564">https://t4mvc.codeplex.com/SourceControl/network/forks/kev_bite/T4mvcTaskBasedActions/contribution/4564</a></li></ul>
<h3>3.5.4 (4-22-2013)</h3>
<ul><li>Make action results internal to avoid cross project conflicts</li></ul>
<h3>3.5.3 (4-19-2013):</h3>
<ul><li>Add support for portable areas without a standard area folder</li></ul>
<h3>3.5.2 (3-07-2013):</h3>
<ul><li>Add support for inherited controller attributes. <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/4194">http://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/4194</a></li></ul>
<h3>3.5.1 (2-25-2013):</h3>
<ul><li>If static files include a timestamp, previously for minified CSS- and JavaScript-files the timestamp was generated by taking the last change time of the unminified file. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4122">https://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4122</a></li></ul>
<h3>3.5.0 (2-08-2013):</h3>
<ul><li>Sign T4MVCExtensions.dll <a href="http://t4mvc.codeplex.com/discussions/432534">http://t4mvc.codeplex.com/discussions/432534</a></li>
<li>Call T4Extension.TimestampString through delegate for unit testing <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4040">http://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4040</a></li></ul>
<h3>3.4.1 (1-31-2013):</h3>
<ul><li>Make T4MVCHelpers internal to avoid cross project conflicts <a href="http://t4mvc.codeplex.com/workitem/17">http://t4mvc.codeplex.com/workitem/17</a></li></ul>
<h3>3.4.0 (1-23-2013):</h3>
<ul><li>Add optional support for async methods <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/3958">https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/3958</a></li>
<li>Generate partial methods to allow custom &quot;overloading&quot; of the return values.</li></ul>
<h3>3.3.0 (1-16-2013):</h3>
<ul><li> Add support for support for model unbinder providers <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/Augi/T4MVCUnbinderProvider/contribution/3879">https://t4mvc.codeplex.com/SourceControl/network/forks/Augi/T4MVCUnbinderProvider/contribution/3879</a></li>
<li> Fix handling of &quot;completed&quot; methods <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/phw/t4mvc/contribution/3922">https://t4mvc.codeplex.com/SourceControl/network/forks/phw/t4mvc/contribution/3922</a></li></ul>
<h3>3.2.1 (12-27-2012):</h3>
<ul><li> Fix issue with VB projects causing exceptions <a href="http://t4mvc.codeplex.com/workitem/7">http://t4mvc.codeplex.com/workitem/7</a></li></ul>
<h3>3.2.0 (12-11-2012):</h3>
<ul><li> Add option to make parameter names constants <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/WayneBrantley/ParameterNamesToConst/contribution/3762">https://t4mvc.codeplex.com/SourceControl/network/forks/WayneBrantley/ParameterNamesToConst/contribution/3762</a></li></ul>
<h3>3.1.0 (12-09-2012):</h3>
<ul><li>Added JavaScriptReplacableUrl helper <a href="http://t4mvc.codeplex.com/discussions/405911">http://t4mvc.codeplex.com/discussions/405911</a></li></ul>
<h3>3.0.3 (11-30-2012):</h3>
<ul><li>Fix to deal with multiple attributes <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/ArtiomChi/t4mvc/contribution/3723">http://t4mvc.codeplex.com/SourceControl/network/forks/ArtiomChi/t4mvc/contribution/3723</a></li></ul>
<h3>3.0.2 (11-17-2012):</h3>
<ul><li>Add support for generic result types <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/ryanrust/T4MVC/contribution/3653">http://t4mvc.codeplex.com/SourceControl/network/forks/ryanrust/T4MVC/contribution/3653</a></li></ul>
<h3>3.0.1 (11-16-2012):</h3>
<ul><li>Fix T4MVC.tt.settings.xml so it only gets generated when needed <a href="https://t4mvc.codeplex.com/discussions/403390">https://t4mvc.codeplex.com/discussions/403390</a></li></ul>
<h3>3.0.0 (11-14-2012):</h3>
<ul><li>Move all the non-dynamic code to a separate T4MVCExtensions.dll assembly</li>
<li>Change generated code brace style to Allman</li>
<li>Added many new RouteLink/BeginRouteForm/RouteUrl helpers</li></ul>
<h3>2.13.0 (10-24-2012):</h3>
<ul><li>Move settings to T4MVC.tt.settings.xml XML file instead of tt file. See doc for details.</li>
<li>Make simple view names available alongside full names, e.g. MVC.Home.Views.SomeView vs MVC.Home.Views.ViewNames.SomeView</li></ul>
<h3>2.12.0 (10-16-2012):</h3>
<ul><li>Add support for static files in nested folders <a href="http://t4mvc.codeplex.com/workitem/6">http://t4mvc.codeplex.com/workitem/6</a></li>
<li>Add MVC 4 bundle starter classes <a href="https://t4mvc.codeplex.com/discussions/399205">https://t4mvc.codeplex.com/discussions/399205</a></li></ul>
<h3>2.11.2 (10-11-2012):</h3>
<ul><li>Removed optional params in ActionLink to support expression trees <a href="http://t4mvc.codeplex.com/workitem/4">http://t4mvc.codeplex.com/workitem/4</a></li>
<li>Change brace style of generated code to Allman</li></ul>
<h3>2.11.1 (10-10-2012):</h3>
<ul><li>Ignore methods that return generic types <a href="http://mvccontrib.codeplex.com/workitem/7178">http://mvccontrib.codeplex.com/workitem/7178</a></li></ul>
<h3>2.11.0 (10-09-2012):</h3>
<ul><li>Corrects the ActionParameters class for overloaded actions to list all parameters and not just the parameters from the first action found.</li></ul>
<h3>2.10.4 (10-05-2012):</h3>
<ul><li>Added attributes so it builds clean under Code Analysis <a href="http://t4mvc.codeplex.com/workitem/10">http://t4mvc.codeplex.com/workitem/10</a></li></ul>
<h3>2.10.3 (09-30-2012):</h3>
<ul><li>Fix crash when querystring contains a null key <a href="http://t4mvc.codeplex.com/discussions/396916">http://t4mvc.codeplex.com/discussions/396916</a></li></ul>
<h3>2.10.2 (09-17-2012):</h3>
<ul><li>Fix UnbindModel to avoid failing on duplicate entries <a href="http://t4mvc.codeplex.com/discussions/394529">http://t4mvc.codeplex.com/discussions/394529</a></li>
<li>Fix ModelUnbinder code generation when SplitIntoMultipleFiles is false <a href="http://t4mvc.codeplex.com/workitem/9">http://t4mvc.codeplex.com/workitem/9</a></li></ul>
<h3>2.10.1 (07-31-2012):</h3>
<ul><li>Fixed default param regression with model unbinder code (<a href="http://stackoverflow.com/questions/11566207/t4mvc-optionalparameter-values-implied-from-current-context/11603897">http://stackoverflow.com/questions/11566207/t4mvc-optionalparameter-values-implied-from-current-context/11603897</a>)</li></ul>
<h3>2.10.0 (07-03-2012):</h3>
<ul><li>Added support for custom model binders (<a href="https://t4mvc.codeplex.com/discussions/357386">https://t4mvc.codeplex.com/discussions/357386</a>)</li>
<li>Fixed unreachable code warning</li></ul>
<h3>2.9.0 (06-22-2012):</h3>
<ul><li>Added support for minified css files (<a href="https://t4mvc.codeplex.com/discussions/360443">https://t4mvc.codeplex.com/discussions/360443</a>)</li>
<li>Replaced improper new RouteValueDictionary usage on htmlAttributes</li></ul>
<h3>2.8.1 (04-12-2012):</h3>
<ul><li>Also default to https for the default (no param) action overload</li>
<li>Make T4MVCHelpers class public so that test code in a different assembly can access it</li></ul>
<h3>2.8 (03-25-2012):</h3>
<ul><li>Generate parameter constants for action methods. e.g. MVC.MyController.MethodParams.someParam</li>
<li>Default to https for Action Methods marked as RequireHttps (either at controller or action level)</li></ul>
<h3>2.7.0 (03-09-2012):</h3>
<ul><li>Removed support for MVC earlier than 3, and for CLR earlier than 4.0</li>
<li>Fix ActionLink to work with MVC4 (<a href="http://mvccontrib.codeplex.com/workitem/7191">http://mvccontrib.codeplex.com/workitem/7191</a>)</li></ul>
<h3>2.6.68 (02-03-2012):</h3>
<ul><li>Ignore static ctors when looking for ctors (<a href="http://mvccontrib.codeplex.com/workitem/7185">http://mvccontrib.codeplex.com/workitem/7185</a>)</li></ul>
<h3>2.6.67 (12-24-2011):</h3>
<ul><li>Restore Actions token that wasn&#39;t obsolete after all. Oops. (<a href="http://stackoverflow.com/questions/8625462/t4mvc-actions-token">http://stackoverflow.com/questions/8625462/t4mvc-actions-token</a>)</li></ul>
<h3>2.6.66 (12-22-2011):</h3>
<ul><li>Disable constant generation in UseLowercaseRoutes mode (<a href="http://stackoverflow.com/questions/8605868/t4mvc-2-6-65-and-uselowercaseroutes-true-error">http://stackoverflow.com/questions/8605868/t4mvc-2-6-65-and-uselowercaseroutes-true-error</a>)</li>
<li>Remove obsolete Actions token (<a href="http://stackoverflow.com/questions/8536269/what-is-the-difference-between-these-2-definitions-in-t4mvc/8543510">http://stackoverflow.com/questions/8536269/what-is-the-difference-between-these-2-definitions-in-t4mvc/8543510</a>)</li></ul>
<h3>2.6.65 (12-06-2011):</h3>
<ul><li>Add true constant strings for use in attributes (<a href="http://mvccontrib.codeplex.com/workitem/7177">http://mvccontrib.codeplex.com/workitem/7177</a>)</li></ul>
<h3>2.6.64 (10-21-2011):</h3>
<ul><li>Fix issue when action parameter name is escaped using @ syntax (e.g. int @event)</li></ul>
<h3>2.6.63 (10-13-2011):</h3>
<ul><li>Move hard coded T4MVC namespace into settings file</li></ul>
<h3>2.6.62 (08-13-2011):</h3>
<ul><li>Replace some unwanted tab characters with whitespace</li></ul>
<h3>2.6.61 (08-01-2011):</h3>
<ul><li>Ignore generic action methods (<a href="http://mvccontrib.codeplex.com/workitem/7156">http://mvccontrib.codeplex.com/workitem/7156</a>)</li></ul>
<h3>2.6.60 (07-28-2011):</h3>
<ul><li>Added support for portable areas. Enabled by adding area names to PortableAreas in T4MVC.tt.settings.t4</li>
<li>When generating links and views, if the folder name is the same as the parent, add a modifier to avoid class name conflicts (<a href="http://mvccontrib.codeplex.com/workitem/7153">http://mvccontrib.codeplex.com/workitem/7153</a>)</li></ul>
<h3>2.6.59 (07-12-2011):</h3>
<ul><li>Added commented out logic to show how to debug into the template (<a href="http://mvccontrib.codeplex.com/workitem/7144">http://mvccontrib.codeplex.com/workitem/7144</a>)</li>
<li>Ignore any class which name doesn&#39;t end with &quot;Controller&quot;</li></ul>
<h3>2.6.58 (06-24-2011):</h3>
<ul><li>Change the controller detection logic to be more reliable and ignore anything that doesn&#39;t extend Controller.</li></ul>
<h3>2.6.57 (06-21-2011):</h3>
<ul><li>Re-added Html.ActionLink/Url.Action overload without default params to avoid running into &quot;CS0854: An expression tree may not contain a call or invocation that uses optional arguments&quot;</li>
<li>Make ProcessControllerActionMethods look for ControllerBase instead of Controller to support controllers like MailerBase (from ActionMailer) which extend ControllerBase.</li></ul>
<h3>2.6.56 (06-05-2011):</h3>
<ul><li>Added optional Html.ActionLink parameters for protocol, hostname and fragment (<a href="http://stackoverflow.com/questions/6280347/how-can-i-add-a-hash-fragment-to-t4mvc-route-dictionary-actionresult/6302703">http://stackoverflow.com/questions/6280347/how-can-i-add-a-hash-fragment-to-t4mvc-route-dictionary-actionresult/6302703</a>)</li></ul>
<h3>2.6.55 (06-05-2011):</h3>
<ul><li>Added optional Url.Action parameters for protocol and hostname (<a href="http://stackoverflow.com/questions/6240568/t4mvc-doesnt-work-property-with-url-action">http://stackoverflow.com/questions/6240568/t4mvc-doesnt-work-property-with-url-action</a>)</li></ul>
<h3>2.6.54 (04-23-2011):</h3>
<ul><li>Added missing license to NuGet package and fixed some links. No actual template changes!</li></ul>
<h3>2.6.53 (04-18-2011):</h3>
<ul><li>Ignore actions marked as obsolete (<a href="http://mvccontrib.codeplex.com/workitem/7133">http://mvccontrib.codeplex.com/workitem/7133</a>)</li></ul>
<h3>2.6.52 (04-14-2011):</h3>
<ul><li>Moved the &#39;Dummy&#39; class under the GenerateMvcT4Extensions check</li>
<li>Always include the area token in the route values unless running on MVC 1.x</li></ul>
<h3>2.6.51 (04-12-2011):</h3>
<ul><li>Ignore async completion methods as they can&#39;t really be used in T4MVC, and can cause issues (<a href="http://stackoverflow.com/questions/5419173/t4mvc-asynccontroller">http://stackoverflow.com/questions/5419173/t4mvc-asynccontroller</a>)</li></ul>
<h3>2.6.50 (04-08-2011):</h3>
<ul><li>Added AddTimestampToStaticLink() method to settings file to allow more granular decision (per <a href="http://mvccontrib.codeplex.com/workitem/7129">this post</a>)</li>
<li>Added GenerateMvcT4Extensions settings flag to omit the generation of the System.Web.Mvc.T4Extensions class, which can be useful if it is already defined in a referenced library (see <a href="http://stackoverflow.com/questions/5563163/t4mvc-use-extension-methods-in-control-library/5574227">this post</a>)</li></ul>
<h3>2.6.44 (03-10-2011):</h3>
<ul><li>Added UseNonQualifiedViewNames flag which when set to true causes view names never to be fully qualified. Spark users may need that.</li></ul>
<h3>2.6.43 (02-24-2011):</h3>
<ul><li>Renamed T4MVC.settings.t4 to T4MVC.tt.settings.t4 so it feels more like a &#39;child&#39; file of T4MVC.tt</li></ul>
<h3>2.6.42 (02-01-2011):</h3>
<ul><li>Fix partial view support for MVC</li>
<li>Fix partial view support when name has periods (<a href="http://mvccontrib.codeplex.com/workitem/7113">http://mvccontrib.codeplex.com/workitem/7113</a>)</li></ul>
<h3>2.6.41 (01-17-2011):</h3>
<ul><li>Added AJAX BeginForm overloads</li></ul>
<h3>2.6.40 (01-05-2011):</h3>
<ul><li>Added BeginForm overload that just takes an ActionResult</li>
<li>Fix MapRouteArea to use UseNamespaceFallback when there are no namespaces</li></ul>
<h3>2.6.32 (12-15-2010):</h3>
<ul><li>Fix bug in controller name generation when IncludeAreasToken is true</li></ul>
<h3>2.6.31 (11-15-2010):</h3>
<ul><li>Improve error message when T4MVC generated files are out of date.</li>
<li>Changed some &#39;const bool&#39; settings to &#39;static bool&#39; to avoid unused code warnings.</li>
<li>Disabled regen optimization added in 2.6.14 since it doesn&#39;t catch view changes</li></ul>
<h3>2.6.30 (09-05-2010):</h3>
<ul><li>Changed ExplicitHtmlHelpersForPartials flag to be off by default (and fix a small issue when it&#39;s off)</li>
<li>Handled System.NotImplementedException if project type (e.g. Installer) does not implement CodeModel property</li>
<li>Fixed issue when action method params are all optional (<a href="http://stackoverflow.com/questions/3488610/t4mvc-and-named-parameters">http://stackoverflow.com/questions/3488610/t4mvc-and-named-parameters</a>)</li>
<li>Exclude Area related methods when using MVC 1.0, as that was breaking things</li>
<li>Added logic to special case DisplayTemplates/EditorTemplates folders, since they need short view names passed in</li></ul>
<h3>2.6.21 (07-20-2010):</h3>
<ul><li>Fix to the partial extension feature added in 2.6.20 to deal with conflicts</li></ul>
<h3>2.6.20 (07-19-2010):</h3>
<ul><li>Added extension methods to render partial views (see <a href="http://www.weirdlover.com/2010/05/12/t4mvc-extension-for-mvc-partials/">this post</a>)
<ul><li>e.g. Html.RenderPartial(&quot;Map&quot;, Model.Dinner); --&gt; Html.RenderMap(Model.Dinner);</li>
<li>Can be turned off in settings file via ExplicitHtmlHelpersForPartials flag.</li></ul></li></ul>
<h3>2.6.15 (05-16-2010):</h3>
<ul><li>Added missing MapRoute overloads to support namespaces</li>
<li>Added MapRoute extensions on AreaRegistrationContext to support areas. Had to name them MapRouteArea to avoid clash with existing MapRoute methods :(</li></ul>
<h3>2.6.14 (05-06-2010):</h3>
<ul><li>Added UseLowercaseRoutes flag to lower case the area, controller and action names in routes</li>
<li>Added support for Views folders that don&#39;t match a controller name.</li>
<li>Added optimization to not regenerate files when the controller has not changed since the last generation</li>
<li>Turn AlwaysKeepTemplateDirty to false by default. We now have an <a href="http://blogs.msdn.com/davidebb/archive/2010/03/18/an-even-better-way-to-run-t4mvc-a-vs-addin.aspx">addin</a> which provides a better solution to this</li></ul>
<h3>2.6.13 (03-08-2010):</h3>
<ul><li>Added AddTimestampToStaticLinks flag to T4MVC.settings.t4 to generate static links that change when the file changes.</li>
<li>Added support for [Bind(Prefix = &quot;newParamName&quot;)] attribute so it generates the correct route value</li>
<li>Added an AddRouteValues overload that takes NameValueCollection, e.g.
<ul><li>MVC.Home.About().AddRouteValues(Request.QueryString)</li></ul></li>
<li>Added MapRoute overload that supports contraints</li>
<li>Removed some logic to support VS2010 Beta 2. VS2010 RC or later should now be used.</li></ul>
<h3>2.6.12 (01-15-2010):</h3>
<ul><li>Fixed issue where some special project types (e.g. DB projects) were throwing while enumerating over the list</li>
<li>Changed to use GeneratedCode attribute instead of the less correct CompilerGenerated</li>
<li>Fixed CompilerGenerated/DebuggerNonUserCode attributes so they don&#39;t incorrectly affect the control classes</li>
<li>Change to avoid adding area to route if the app is not using areas</li></ul>
<h3>2.6.11 (01-10-2010):</h3>
<ul><li>Added ExcludedStaticFileExtensions setting to T4MVC.settings.t4 to list extensions for which static links should not be generated.</li>
<li>Support configurable name for IT4MVCActionResult, and it being defined externally (for sharing pourpose)</li>
<li>Added DebuggerNonUserCode attribute to generated classes</li>
<li>Improved error handling when trying to call T4MVC method with real ActionResult (previous threw InvalidCast)</li>
<li>Fix issue when overridden action methods were incorrectly marked as virtual</li></ul>
<h3>2.6.10 (01-04-2010):</h3>
<ul><li>Added support for adding arbitrary route parameters to T4MVC actions. e.g.
<ul><li>MVC.Home.About().AddRouteValue(&quot;fooKey&quot;, bar.Foo.Key)</li>
<li>MVC.Home.About().AddRouteValues(new {fooKey = bar.Foo.Key, barKey = bar.Key})</li></ul></li>
<li>Added shorter to refer to controller actions from with the controller itself. e.g.
<ul><li>return RedirectToAction(MVC.MyController.Actions.About()); BECOMES:</li>
<li>return RedirectToAction(Actions.About());</li></ul></li>
<li>What was previously called Actions was renamed to ActionNames (note, that&#39;s a BREAKING CHANGE if you used Actions before!)</li>
<li>Ignore controller methods that are marked with a NonAction attribute</li>
<li>Renamed IT4MVCActionResult.RouteValues to avoid conflict (this should not break anything, as it&#39;s only used internally)</li></ul>
<h3>2.6.03 (12-10-2009):</h3>
<ul><li>Generate full view paths to allow cross controller references
<ul><li>e.g. MVC.Dinners.Views.DinnerForm is now &quot;~/Views/Dinners/DinnerForm.ascx&quot; instead of just &quot;DinnerForm&quot;</li></ul></li>
<li>Fix compile error when a view name is a language keyword (e.g. string.ascx)</li></ul>
<h3>2.6.02 (12-04-2009)</h3>
<ul><li>Added way to get area name from both Area and Controller objects
<ul><li>e.g. MVC.MyArea.Name and MVC.MyArea.MyController.Area</li></ul></li>
<li>Added support for controllers in the default namespace (i.e. no namespace)</li>
<li>Always include the area in the route data, even when it&#39;s null/empty</li></ul>
<h3>2.6.01 (12-02-2009)</h3>
<ul><li>Fix compile error when a custom ActionResult type has a ctor that takes a value type</li></ul>
<h3>2.6.00 (11-28-2009)</h3>
<ul><li>Added support for MVC 2 Areas</li>
<li>Fixed issue where non-existing RenderAction method gets generated on VS2010 Beta 2</li>
<li>Added check to give proper error when attempting to run T4MVC outside VS (e.g. from TextTransform.exe)</li></ul>
<h3>2.5.02 (11-24-2009)</h3>
<ul><li>Change links in comment to point to new T4MVC home and forum</li>
<li>Fix scenario where a View folder as a name that&#39;s a C# keyword</li></ul>
<h3>2.5.01 (11-20-2009)</h3>
<ul><li>Added support for Html.RenderAction and Html.Action (see http://haacked.com/archive/2009/11/18/aspnetmvc2-render-action.aspx)</li>
<li>Fix null ref exception issue when custom ActionResult type doesn&#39;t have any explicit ctors</li></ul>
<h3>2.5.00 (11-16-2009)</h3>
<ul><li>Incorporated Damien Guard&#39;s multiple output manager to (optionally) split output from T4MVC into separate files to improve source control</li>
<li>Added support for minified javascript files in production</li>
<li>Fixed bug occurring when no action is of type ActionResult</li></ul>
<h3>2.4.04 (10-15-2009)</h3>
<ul><li>Added support for MVC 2 by detecting the version and generating slightly different code</li></ul>
<h3>2.4.03 (10-02-2009)</h3>
<ul><li>Added ProcessVirtualPath method to T4MVC.settings.t4 so user can write custom logic to modify client URL&#39;s</li>
<li>Greatly simplified GetProjectContainingT4File logic by using FindProjectItem().</li>
<li>Renamed generated classes to be CLS compliant</li>
<li>Moved most of the doc and versioning comments from T4MVC.tt into the readme.txt file, as it was getting a bit long.</li></ul>
<h3>2.4.02 (09-02-2009)</h3>
<ul><li>Added a setting in T4MVC.settings.t4 to set the namespace that Links get generated in</li>
<li>Added pragma to prevent compiler from complaining about missing Xml comments</li>
<li>Added &lt;auto-generated /&gt; comment to disable StyleCop in generated file</li>
<li>Fixed issue when using a custom ResultType in a custom namespace. Now fully qualifying result types.</li></ul>
<h3>2.4.01 (07-29-2009):</h3>
<ul><li>Put all the generated code in a T4MVC #region. This is useful to tell tools like ReSharper to ignore it.</li>
<li>Fixed issue where controller methods returning generic types cause template to blow up</li>
<li>Added a setting in T4MVC.settings.t4 to turn off the behavior that always keeps the template dirty</li></ul>
<h3>2.4.00 (07-28-2009):</h3>
<ul><li>Added support for configurable settings in a separate T4MVC.settings.t4 file</li>
<li>Added a parameter-less pseudo-action for every action that doesn&#39;t already have a parameter-less overload</li>
<li>Added support for having T4MVC.tt in a sub folder instead of always at the root of the project</li>
<li>Fixed issue when a base controller doesn&#39;t have a default ctor</li>
<li>Added T4Extensions into System.Web.Mvc namespace to fix ambiguous resolution issue </li>
<li>Misc cleanup</li></ul>
<h3>2.3.01 (07-10-2009):</h3>
<ul><li>Fixed issue with <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName&referringTitle=T4MVC_History">ActionName</a> attribute set to non literal string values (e.g. <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName%28SomeConst%20%2b%20%22Abc%22%29&referringTitle=T4MVC_History">ActionName&#40;SomeConst &#43; &#34;Abc&#34;&#41;</a>)</li>
<li>Fixed duplication issue when partial controller classes have a base type which contains action methods</li>
<li>Skip App_LocalResources when processing views</li>
<li>Cleaned up rendering logic</li></ul>
<h3>2.3.00 (07-07-2009):</h3>
<ul><li>Added support for sub view folders</li>
<li>Added support for <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName&referringTitle=T4MVC_History">ActionName</a> attribute</li>
<li>Improved handling when the controller comes from a different project</li>
<li>Don&#39;t try to process generic controller classes</li></ul>
<h3>2.2.03 (07-06-2009):</h3>
<ul><li>Added support for action methods defined on controller base classes</li>
<li>Improved error handling when not able to change actions to virtual and controllers to partial</li></ul>
<h3>2.2.02 (07-01-2009):</h3>
<ul><li>Fixed break caused by incorrect support for derived ActionResult types in 2.2.01</li>
<li>Fixed issue with duplicate view tokens getting generated when you have both foo.aspx and foo.ascx</li></ul>
<h3>2.2.01 (07-01-2009):</h3>
<ul><li>Added support for action methods that return a type derived from ActionResult (as opposed to exactly an ActionResult)</li>
<li>Fixed issue when controller is using partial classes</li>
<li>Fixed folder handling logic to deal with generated files</li>
<li>Fixed issue with folder names that are C# keyword</li>
<li>Throw NotSupportedException instead of NotImplementedException to avoid being viewed as a TODO</li></ul>
<h3>2.2.00 (06-30-2009):</h3>
<ul><li>Added strongly typed support to MapRoute</li>
<li>Changed constructor generation to avoid confusing IoC containers</li>
<li>Fixed issue with empty Content folder</li>
<li>Fixed issue with abstract controller base classes</li></ul>
<h3>2.1.00 (06-29-2009):</h3>
<ul><li>Added Html.BeginForm overloads that use the strongly typed pattern</li>
<li>Added Url() helpers on static resources to increase flexibility</li>
<li>Changed generated constants (view and action names, static files) to be readonly strings</li>
<li>Fixed null ref exception in Solution Folder logic</li></ul>
<h3>2.0.04 (06-28-2009):</h3>
<ul><li>Fixed issue with files and folders with names starting with a digit</li></ul>
<h3>2.0.03 (06-27-2009):</h3>
<ul><li>Rework code element enumeration logic to work around a VS2010 issue. The template should now work with VS2010 beta 1!</li>
<li>Reduced some redundancy in the generated code</li></ul>
<h3>2.0.02 (06-27-2009):</h3>
<ul><li>Added ActionLink overloads that take object instead of dictionary (from both Html and Ajax)</li></ul>
<h3>2.0.01 (06-26-2009):</h3>
<ul><li>Fixed issue with files and folders with invalid identifier characters (e.g. spaces, &#39;-&#39;, &#39;.&#39;)</li></ul>
<h3>2.0.00 (06-26-2009):</h3>
<ul><li>Added support for refactoring in Action methods</li>
<li>The T4 file automatically runs whenever you build, instead of being done manually</li>
<li>Support for strongly typed links to static resources</li>
<li>Fix: supports controllers that are in sub-folders of the Controllers folder and not directly in there</li>
<li>Fix: works better with nested solution folder </li>
<li>Random other small fixes</li></ul>
<h3>1.0.xx (06-17-2009):</h3>
<ul><li>the original based on <a href="http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx">this post</a></li></ul>
</div><div class="ClearBoth"></div>davidebboMon, 28 Jul 2014 20:47:51 GMTUpdated Wiki: T4MVC_History 20140728084751PUpdated Wiki: Documentationhttps://t4mvc.codeplex.com/documentation?version=17<div class="wikidoc"><h1>T4MVC Documentation page</h1>
<h2>1. Introduction</h2>
T4MVC is a T4 template for ASP.NET MVC apps that creates strongly typed helpers that eliminate the use of literal strings when referring the controllers, actions and views. It helps make your MVC code much more maintainable, and gives you intellisense where you normally would not have any. It was started by <a href="http://twitter.com/#!/davidebbo">David Ebbo</a> as a little blog post thing, and has since gained many new features based on great community feedback.<br /><br />T4MVC runs in Visual Studio 2010, 2012 and 2013, and supports ASP.NET MVC 4.0 and 5.0 (older MVCs may work but are untested).<br /><br />To use it, simply install the T4MVC package using NuGet. You will get T4MVC.tt in your project, and will instantly see a number of files get created in Visual Studio under it.<br /><br />The code in those generated files enable a whole range of scenarios, all relating to replacing unwanted literal strings with a strongly typed alternative. The documentation below gives a complete list of those scenarios.<br />
<h3>1.1 It&#39;s still just standard MVC under the cover</h3>
One key concept to understand about T4MVC is that it is just a thin layer over MVC. e.g. while it provides strong typing, in the end it&#39;s just putting values in a dictionary, and using standard MVC to generate the routes.<br /><br />One thing I often suggest when people have questions is to first figure out how they would do things without T4MVC. If you have no idea how it would work, or think it may not be possible at all, then you are probably expecting too much of T4MVC! Generally, it will not do anything that MVC does not support.<br />
<h2>2. Scenarios</h2>
Instead of a formal documentation, we&#39;ll just demonstrate by example the various scenarios where T4MVC helps improve your code. The examples are shown in a before/after format to outline the change that is made.<br /><br />Note: a lot of the examples given below are based on the <a href="http://nerddinner.codeplex.com/">Nerd Dinner</a> sample MVC application. <br />
<h3>2.1 Using View Name constants</h3>
<br />Any time you would use a literal string to refer to a view, T4MVC gives you a strongly typed alternative. e.g. suppose you have this code in a view:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;% Html.RenderPartial(<span style="color:#A31515;">&quot;DinnerForm&quot;</span>); %&gt;
</pre></div>This ugly “DinnerForm” literal string needs to go! Instead, you can now write:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;% Html.RenderPartial(MVC.Dinners.Views.DinnerForm); %&gt;
</pre></div><br />When you need to use a view name inside a controller, things get even easier. e.g. you can replace:<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> View(<span style="color:#A31515;">&quot;InvalidOwner&quot;</span>);
</pre></div>by<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> View(Views.InvalidOwner);
</pre></div><br />Note how you can omit the MVC.Dinners prefix, since this is implied by the fact that the code lives in the Dinners controller.<br />
<h4>2.1.1 Non-Qualified View Name Constants</h4>
Non-qualified view names can be used via the ViewNames property underneath the Views property. Non-qualified views are usefull for allowing overloading and are needed by certain setups, e.g. Spark.<br /><br />Traditional &quot;Magic String&quot; Non-Qualified view:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> View(<span style="color:#A31515;">&quot;Index&quot;</span>);
</pre></div><br />T4MVC Non-Qualified view:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> View(Views.ViewNames.Index);
</pre></div>
<h3>2.2 Referring to controller actions</h3>
<br />Many MVC APIs follow a pattern where you need to pass three pieces of information in order to refer to a controller action:<br />
<ol><li>the controller name (often implied when dealing with the current controller)</li>
<li>the action method name</li>
<li>the parameters to be passed to the action method</li></ol>
<br />All of this is typically done by passing literal strings for #1 and #2, and an anonymous object for #3, e.g.<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, <span style="color:#A31515;">&quot;Delete&quot;</span>, <span style="color:#A31515;">&quot;Dinners&quot;</span>, <span style="color:Blue;">new</span> { id = Model.DinnerID }, <span style="color:Blue;">null</span>)%&gt;
</pre></div>Here, &quot;Delete&quot; and &quot;Dinners&quot; are clear literal strings that we&#39;d like to get rid of. But that&#39;s not all, as the paramter name &#39;id&#39; is as much of a problem as those other two. Even though it doesn’t look like a literal string, it very much is one in disguise. Don’t let those anonymous objects fool you!<br /><br />With T4MVC, you would instead write:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Dinners.Delete(Model.DinnerID))%&gt;
</pre></div>Basically, we got rid of the three unwanted literal strings (“Delete”, &quot;Dinners&quot; and “Id”), and replaced them by a very natural looking method call to the controller action. Of course, this is not really calling the controller action, which would be very wrong here. But it’s capturing the essence of method call, and turning it into the right route values.<br /><br />One other great benefit of this approach is that you get full intellisense while you type this line. In fact, you even get full refactoring support if you use a tool like resharper which supports aspx refactoring!<br />
<h4>Adding additional route parameters</h4>
In some situation, you may need to add extra values to the route that don’t exist in the action method. You can do it as follows:<br /><br /><div style="color:Black;background-color:White;"><pre>
Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Dinners.Delete(Model.DinnerID)
.AddRouteValue(<span style="color:#A31515;">&quot;foo&quot;</span>, 17))
</pre></div><br />You can add multiple values this way using a fluent approach, e.g.<br /><br /><div style="color:Black;background-color:White;"><pre>
Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Dinners.Delete(Model.DinnerID)
.AddRouteValue(<span style="color:#A31515;">&quot;foo&quot;</span>, 17)
.AddRouteValue(<span style="color:#A31515;">&quot;bar&quot;</span>, <span style="color:#A31515;">&quot;abc&quot;</span>))
</pre></div><br />As an alternative for adding multiple values, you can write:<br /><br /><div style="color:Black;background-color:White;"><pre>
Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Dinners.Delete(Model.DinnerID)
.AddRouteValues(<span style="color:Blue;">new</span> { foo = 17, bar = <span style="color:#A31515;">&quot;abc&quot;</span>}))
</pre></div><br />Note that in some cases, you may want to omit the action method parameters from the route, possibly because they are meant to come from form data and not from the URL. For those cases, you can always use the parameter-less override that T4MVC generates (that part is not new), e.g.<br /><br /><div style="color:Black;background-color:White;"><pre>
Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Dinners.Delete()
.AddRouteValues(<span style="color:Blue;">new</span> { foo = 17, bar = <span style="color:#A31515;">&quot;abc&quot;</span>}))
</pre></div><br />Now suppose you want to add all the current query string values to the route values produced by T4MVC. You can use the AddRouteValues() overload that takes a NameValueCollection. e.g.<br /><br /><div style="color:Black;background-color:White;"><pre>
RedirectToAction(MVC.Home.MyAction().AddRouteValues(Request.QueryString));
</pre></div><br />This adds to the existing set of AddRouteValue/AddRouteValues fluent APIs to make it easier to deal with all kind different situations.<br /><br />The nice thing about this fluent approach is that it doesn’t require adding overloads to all the T4MVC helpers (e.g. Html.ActionLink is this case) to take in the extra route values. Instead, it automatically applies to any method that uses the T4MVC pattern.<br /><br />The general pattern of making a pseudo-call to a controller action is used is many places in T4MVC:<br />
<h4>2.2.1 Html.ActionLink</h4>
Ok, we just covered that one above.<br />
<h4>2.2.2 Url.Action</h4>
<div style="color:Black;background-color:White;"><pre>
&lt;%= Url.Action(MVC.Dinners.Delete(Model.DinnerID))%&gt;
</pre></div>
<h4>2.2.2a Url.JavaScriptReplacableUrl</h4>
Two use cases for the above. <br /><br /><b>1st Use Case:</b><br />If you have an action you want to call from javascript like this:<br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Url.Action(MVC.Dinners.Display(Model.DinnerID))%&gt;
</pre></div>Odds are you want to get the Model.DinnerID from a javascript variable. So you end up with<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">var</span> myUrl=&lt;%= Url.Action(MVC.Dinners.Display())%&gt;
<span style="color:Green;">//myUrl will be /Dinners/Display</span>
<span style="color:Blue;">var</span> myFinalUrl=myUrl+<span style="color:#A31515;">&quot;/&quot;</span>+dinnerId; <span style="color:Green;">///Dinners/Display/12</span>
<span style="color:Green;">//or does it look like </span>
<span style="color:Blue;">var</span> myFinalUrl=myUrl+<span style="color:#A31515;">&quot;?dinnerID&quot;</span>+dinnerId; <span style="color:Green;">///Dinners/Display?dinnerId=12</span>
</pre></div>The issue is you are not sure how to compose the URL and if it changes, this will silently break.<br /><br /><b>2nd Use Case:</b><br />For the above action in your routing table you created a route like:<br />&quot;Dinners/Display/{dinnerId}&quot; - and you constrain dinnerId to be an integer larger than zero.<br /><br />Now, if you do the same scenario above:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">var</span> myUrl=&lt;%= Url.Action(MVC.Dinners.Display())%&gt;
</pre></div>The route will not be found - because there is not a route match (since dinnerId was not provided).<br /><br /><b>JavaScriptReplacableUrl solves both of these issues</b><br />No matter which use case, you define a specific route for the action (constrained parameters or not)<br />In the routing table you add:<br />&quot;Dinners/Display/{dinnerId}&quot; - (constrain dinnerId if you want)<br /><b>Note: You must define a specific route for JavaScriptReplacableUrl to work like this - it cannot work with &#39;default routes&#39;. If it cannot find a matching route it behaves like Url.Action().</b><br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">var</span> myUrl=&lt;%= Url.JavaScriptReplacableUrl(MVC.Dinners.Display())%&gt;
<span style="color:Green;">//myUrl will be Dinners/Display/{dinnerId} </span>
<span style="color:Blue;">var</span> myFinalUrl=myUrl.replace(<span style="color:#A31515;">&quot;{dinnerId}&quot;</span>, dinnerId); <span style="color:Green;">//this will have whatever route shape you defined in routing table!</span>
</pre></div><br />Note you can use the parameter name constants from T4MVC (and that will give you compile time checking for parameter name changes:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">var</span> myFinalUrl=myUrl.replace(<span style="color:#A31515;">&quot;{&quot;</span>+MVC.Dinners.DisplayParams.dinnerId+<span style="color:#A31515;">&quot;}&quot;</span>, dinnerId); <span style="color:Green;">//this will have whatever route shape you defined </span>
</pre></div><br />
<h4>2.2.3 Ajax.ActionLink</h4>
<div style="color:Black;background-color:White;"><pre>
&lt;%= Ajax.ActionLink( <span style="color:#A31515;">&quot;RSVP for this event&quot;</span>,
<span style="color:#A31515;">&quot;Register&quot;</span>, <span style="color:#A31515;">&quot;RSVP&quot;</span>,
<span style="color:Blue;">new</span> { id=Model.DinnerID },
<span style="color:Blue;">new</span> AjaxOptions { UpdateTargetId=<span style="color:#A31515;">&quot;rsvpmsg&quot;</span>, OnSuccess=<span style="color:#A31515;">&quot;AnimateRSVPMessage&quot;</span> }) %&gt;
</pre></div>becomes<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Ajax.ActionLink( <span style="color:#A31515;">&quot;RSVP for this event&quot;</span>,
MVC.RSVP.Register(Model.DinnerID),
<span style="color:Blue;">new</span> AjaxOptions { UpdateTargetId=<span style="color:#A31515;">&quot;rsvpmsg&quot;</span>, OnSuccess=<span style="color:#A31515;">&quot;AnimateRSVPMessage&quot;</span> }) %&gt;
</pre></div>
<h4>2.2.4 RedirectToAction (in controller code)</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> RedirectToAction(<span style="color:#A31515;">&quot;Details&quot;</span>, <span style="color:Blue;">new</span> { id = dinner.DinnerID });
</pre></div>becomes<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> RedirectToAction(MVC.Dinners.Details(dinner.DinnerID));
</pre></div>
<h4>2.2.5 routes.MapRoute (typically in global.asax)</h4>
<div style="color:Black;background-color:White;"><pre>
routes.MapRoute(
<span style="color:#A31515;">&quot;UpcomingDinners&quot;</span>,
<span style="color:#A31515;">&quot;Dinners/Page/{page}&quot;</span>,
<span style="color:Blue;">new</span> { controller = <span style="color:#A31515;">&quot;Dinners&quot;</span>, action = <span style="color:#A31515;">&quot;Index&quot;</span> }
);
</pre></div>becomes<br /><br /><div style="color:Black;background-color:White;"><pre>
routes.MapRoute(
<span style="color:#A31515;">&quot;UpcomingDinners&quot;</span>,
<span style="color:#A31515;">&quot;Dinners/Page/{page}&quot;</span>,
MVC.Dinners.Index(<span style="color:Blue;">null</span>)
);
</pre></div>
<h4>2.2.6 Html.BeginForm</h4>
Essentially, it’s the same support as ActionLink() but for the BeginForm() method. But note that because form posts typically pass most of the data via the form and not the URL, BeginForm() is trickier to use correctly than the other methods.<br /><br />Here is how you might use this:<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">using</span> (Html.BeginForm(MVC.Account.LogOn(), FormMethod.Post)) { ... }
</pre></div>Or if the action method takes parameters, you would pass them in the call. However, when you do this you need to make sure that you aren’t also trying to pass those same parameters via the form (e.g. using a text box).<br /><br />Generally, the rule of thumb is that this support works well when you’re dealing with forms where the Action method signature exactly matches the form URL.<br />
<h4>2.2.7 Html.RenderAction and Html.Action (only in MVC 2 or newer)</h4>
These are new to MVC 2. See Phil Haack&#39;s <a href="http://haacked.com/archive/2009/11/18/aspnetmvc2-render-action.aspx">post</a> about them for details.<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.Action(<span style="color:#A31515;">&quot;Menu&quot;</span>, <span style="color:Blue;">new</span> { options = <span style="color:Blue;">new</span> MenuOptions { Width=400, Height=500} })%&gt;
</pre></div>becomes<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.Action(MVC.Home.Menu(<span style="color:Blue;">new</span> MenuOptions { Width=400, Height=500})); %&gt;
</pre></div>Same deal for Html.RenderAction.<br />
<h3>2.3. Use constants to refer to area, controller, action and parameter names</h3>
<h4>2.3.1 Area name constants</h4>
<div style="color:Black;background-color:White;"><pre>
MVC.CoolArea.Name
</pre></div>
<h4>2.3.2 Controller name constants</h4>
<div style="color:Black;background-color:White;"><pre>
MVC.Home.Name
</pre></div>
<h4>2.3.3 Action name constants</h4>
<div style="color:Black;background-color:White;"><pre>
MVC.Home.ActionNames.Index
</pre></div>
<h4>2.3.4 Parameter name constants</h4>
Assuming a Home.MyAction action that takes a foo parameter, this evaluates to &quot;foo&quot;:<br /><br /><div style="color:Black;background-color:White;"><pre>
MVC.Home.MyActionParams.foo
</pre></div><br />
<h3>2.4. Strongly typed links to script files and static resources</h3>
<br />T4MVC generates static helpers for your content files and script files. So instead of writing:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;img src=<span style="color:#A31515;">&quot;/Content/nerd.jpg&quot;</span> /&gt;
</pre></div>You can write:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;img src=<span style="color:#A31515;">&quot;&lt;%= Links.Content.nerd_jpg %&gt;&quot;</span> /&gt;
</pre></div>Likewise, instead of<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;script src=<span style="color:#A31515;">&quot;/Scripts/Map.js&quot;</span> type=<span style="color:#A31515;">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;
</pre></div>You can write<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;script src=<span style="color:#A31515;">&quot;&lt;%= Links.Scripts.Map_js %&gt;&quot;</span> type=<span style="color:#A31515;">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;
</pre></div>The obvious benefit is that you’ll get a compile error if you ever move or rename your static resource, so you’ll catch it earlier.<br /><br />Another benefit is that you get a more versatile reference. When you write src=&quot;/Content/nerd.jpg&quot;, your app will only work when it’s deployed at the root of the site. But when you use the helper, it executes some server side logic that makes sure your reference is correct wherever your site is rooted. It does this by calling VirtualPathUtility.ToAbsolute(&quot;~/Content/nerd.jpg&quot;).<br /><br />One unfortunate thing is that for some reason, VS doesn’t support intellisense in the view for parameter values. As a workaround, you can type it outside of the tag to get intellisense and then copy it there.<br /><br /><b>Important note</b>: if you see strange links getting generated in your &lt;head&gt; tag, you just need to remove the runat=&quot;server&quot; from it.<br />
<h4> Support for MVC&#39;s script and style bundles</h4>
Starting from MVC4, one can define &quot;bundles&quot; of scripts and stylesheets which are automatically combined and minified. However, magic strings are used to define the resource URLs. To eliminate them, follow steps 1 to 3 below.<br /><br />1. Add the following to your own code, which will extend T4MVC&#39;s static partial &quot;Links.bundles.scripts&quot; and &quot;Links.bundles.styles&quot; classes:<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">namespace</span> Links {
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">partial</span> <span style="color:Blue;">class</span> bundles {
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">partial</span> <span style="color:Blue;">class</span> scripts {
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">readonly</span> <span style="color:Blue;">string</span> jquery = <span style="color:#A31515;">&quot;~/scripts/jquery&quot;</span>;
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">readonly</span> <span style="color:Blue;">string</span> jqueryui = <span style="color:#A31515;">&quot;~/scripts/jqueryui&quot;</span>;
}
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">partial</span> <span style="color:Blue;">class</span> styles {
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">readonly</span> <span style="color:Blue;">string</span> bootstrap = <span style="color:#A31515;">&quot;~/styles/boostrap&quot;</span>;
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">readonly</span> <span style="color:Blue;">string</span> theme = <span style="color:#A31515;">&quot;~/styles/theme&quot;</span>;
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">readonly</span> <span style="color:Blue;">string</span> common = <span style="color:#A31515;">&quot;~/styles/common&quot;</span>;
}
}
}
</pre></div><br />Notice how the magic strings are now defined in one place only, and are thus easy to maintain.<br /><br />2. Use the following to add your bundles to the runtime:<br /><br /><div style="color:Black;background-color:White;"><pre>
bundles.Add(<span style="color:Blue;">new</span> ScriptBundle(Links.bundles.scripts.jquery).Include(<span style="color:#A31515;">&quot;~/scripts/jquery-{version}.js&quot;</span>));
bundles.Add(<span style="color:Blue;">new</span> StyleBundle(Links.bundles.styles.bootstrap).Include(<span style="color:#A31515;">&quot;~/styles/bootstrap*.css&quot;</span>));
</pre></div><br />3. Use the following to use a bundle in a cshtml layout/view:<br /><br /><div style="color:Black;background-color:White;"><pre>
@Scripts.Render(Links.bundles.scripts.jquery)
@Styles.Render(Links.bundles.scripts.bootstrap)
</pre></div>
<h4>Support for Minified Javascript files</h4>
Minified javascript files are alternate version of the files that makes them as small as possible, but using various strategies like removing white space. e.g. in an MVC application’s Scripts folder, you’ll typically see both jquery-1.3.2.js and jquery-1.3.2.min.js. Usually, you want to use the minified version at deployment time (to make your site load faster), but the regular version at development time, so you can more easily debug into it.<br /><br />T4MVC makes it automatic to use one vs. the other depending on the context. e.g. suppose you have:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;script src=<span style="color:#A31515;">&quot;&lt;%= Links.Scripts.jquery_1_2_6_js %&gt;&quot;</span> type=<span style="color:#A31515;">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;
</pre></div>You don’t need to change anything to this line, but the token jquery_1_2_6_js will automatically point to either jquery-1.3.2.js or jquery-1.3.2.min.js depending on whether you’re running in production. How does it know whether you’re in production? It calls a method defined in T4MVC.tt.hooks.t4 which makes the decision. By default, it looks at whether debugging is enabled:<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">// Logic to determine if the app is running in production or dev environment</span>
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">bool</span> IsProduction() {
<span style="color:Blue;">return</span> (HttpContext.Current != <span style="color:Blue;">null</span> &amp;&amp; !HttpContext.Current.IsDebuggingEnabled);
}
</pre></div><br />But you can easily change this logic if you have a different way of determining ‘production’.<br />
<h3>2.5 Using T4MVC with &quot;Areas&quot;</h3>
<br />One of MVC 2&#39;s major new features is the support for breaking up a large application into &quot;Areas&quot;. This works by following a structure that looks like:<br />
<ul><li>Root folder
<ul><li>Areas
<ul><li>NerdDinner
<ul><li>Models</li>
<li>Views</li>
<li>Controllers</li></ul></li>
<li>Wiki
<ul><li>Models</li>
<li>Views</li>
<li>Controllers</li></ul></li></ul></li></ul></li></ul>
<br />T4MVC automatically works with your areas and makes them available in its object model. Here is an example:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.NerdDinner.Dinners.Delete(Model.DinnerID))%&gt;
</pre></div>Notice how we refered to the controller as MVC.<b>NerdDinner</b>.Dinners. Note that if you happen to have a top level controller with the same name as the area, this naming pattern would cause a conflict. In that case, T4MVC appends &#39;Area&#39; at the end of the area name to avoid the conflict. e.g. If you have both a Home area and a Home controller (top level), you would use MVC.Home<b>Area</b>.Hello to refer to the area.<br /><br />Optionally, if you set IncludeAreasToken to true in the settings.xml file, the naming scheme becomes:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Areas.NerdDinner.Dinners.Delete(Model.DinnerID))%&gt;
</pre></div>Note that in this case, the conflict situation discussed above cannot occur. But this comes with a price as you end up with one more segment all the time. I&#39;m debating whether to even keep this mode given that the default mode works quite well.<br />
<h4>2.5.1 Alternative &quot;Feature Folder&quot; project structure</h4>
The &quot;Feature Folders&quot; convention is an alternative folder structure in which files within an area are grouped by feature (e.g. &quot;Home&quot;, &quot;Account&quot;) instead of file-type (&quot;Controllers&quot;, &quot;Views&quot;):<br />
<ul><li>Root folder
<ul><li>Areas
<ul><li>Forum
<ul><li>Posts
<ul><li>PostsController.cs</li>
<li>List.cshtml</li>
<li>Create.cshtml</li></ul></li>
<li>Categories
<ul><li>CategoriesController.cs</li>
<li>List.cshtml</li></ul></li></ul></li></ul></li></ul></li></ul>
<br />To enable this in ASP.NET MVC, you must create a custom ViewEngine that resolves the view paths correctly. Controllers aren&#39;t bound to a &quot;Controllers&quot;-folder anyway, so nothing must be changed for them. The ViewEngine could be implemented as follows:<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">public</span> <span style="color:Blue;">class</span> FeatureFolderViewEngine : RazorViewEngine
{
<span style="color:Blue;">public</span> FeatureFolderViewEngine()
{
<span style="color:Green;">// {0} ActionName; {1} ControllerName; {2} AreaName</span>
AreaViewLocationFormats = <span style="color:Blue;">new</span>[]
{
<span style="color:#A31515;">&quot;~/Areas/{2}/{1}/{0}.cshtml&quot;</span>,
<span style="color:#A31515;">&quot;~/Areas/{2}/SharedViews/{0}.cshtml&quot;</span>, <span style="color:Green;">// Replacement for &quot;Views/Shared&quot;</span>
};
AreaMasterLocationFormats = <span style="color:Blue;">new</span>[]
{
<span style="color:#A31515;">&quot;~/Areas/{2}/{1}/{0}.cshtml&quot;</span>,
<span style="color:#A31515;">&quot;~/Areas/{2}/SharedViews/{0}.cshtml&quot;</span>,
};
AreaPartialViewLocationFormats = <span style="color:Blue;">new</span>[]
{
<span style="color:#A31515;">&quot;~/Areas/{2}/{1}/{0}.cshtml&quot;</span>,
<span style="color:#A31515;">&quot;~/Areas/{2}/SharedViews/{0}.cshtml&quot;</span>,
};
<span style="color:Green;">// see System.Web.Mvc.RazorViewEngine for default settings if you want to have Controllers/Views in the root of your project</span>
ViewLocationFormats = <span style="color:Blue;">new</span>[] { ... };
MasterLocationFormats = <span style="color:Blue;">new</span>[] { ... };
PartialViewLocationFormats = <span style="color:Blue;">new</span>[] { ... };
FileExtensions = <span style="color:Blue;">new</span>[] { <span style="color:#A31515;">&quot;cshtml&quot;</span> };
}
}
</pre></div><br />Starting with version 3.9.0, T4MVC supports this structure with the optional settings parameter <b>FeatureFolderAreas</b>. <br /><br />If every area in your project follows this convention, you can set it to &quot;*&quot;:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">FeatureFolderAreas</span><span style="color:Blue;">&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">Area</span><span style="color:Blue;">&gt;</span>*<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">Area</span><span style="color:Blue;">&gt;</span>
<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">FeatureFolderAreas</span><span style="color:Blue;">&gt;</span>
</pre></div><br />If only certain areas follow this convention, you can specify them with separate Area-tags:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">FeatureFolderAreas</span><span style="color:Blue;">&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">Area</span><span style="color:Blue;">&gt;</span>Forum<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">Area</span><span style="color:Blue;">&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">Area</span><span style="color:Blue;">&gt;</span>Wiki<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">Area</span><span style="color:Blue;">&gt;</span>
<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">FeatureFolderAreas</span><span style="color:Blue;">&gt;</span>
</pre></div><br />Since T4MVC by default creates entries for every file within a Views-folder you have to exclude &quot;.cs&quot;-files. Otherwise you would also get a &quot;Views&quot;-entry for your controller or other classes within the folder. This file extension has been added to the settings file in v3.9.0! If it&#39;s not present in your project, you can add it as follows:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">ExcludedViewExtensions</span><span style="color:Blue;">&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">Extension</span><span style="color:Blue;">&gt;</span>.cs<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">Extension</span><span style="color:Blue;">&gt;</span>
<span style="color:Green;">&lt;!-- ... --&gt;</span>
<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">ExcludedViewExtensions</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h3>2.6 Using T4MVC with AsyncController</h3>
<h4>2.6.1 Enable Asynchronous Action Support</h4>
To enable support for using asynchronous actions in T4MVC you first need to change the SupportAsyncActions setting to true. This is setting is false by default since Async action calls are handled a little differently than normal action calls.<br />
<h4>2.6.1 What it does</h4>
When enabled any AsyncController with an <b>Async action will have two new methods generated in it. The first method is the standard Parameterless Overload and the second one one with the same signature as the </b>Async method but with out the Async extension. In addition, this method returns the standard ActionResult regarless of the possible return types of the *Completed methods. <br /><br />For example the following action in your controller<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">public</span> <span style="color:Blue;">void</span> IndexAsync(<span style="color:Blue;">long</span> id)
{
...
}
<span style="color:Blue;">public</span> JsonResult IndexCompleted(Models.SomeModel model)
{
<span style="color:Blue;">return</span> <span style="color:Blue;">this</span>.JSON(model);
}
</pre></div><br />would cause the following code to be generated by T4MVC<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">public</span> <span style="color:Blue;">virtual</span> ActionResult Index()
{
...
}
<span style="color:Blue;">public</span> <span style="color:Blue;">virtual</span> ActionResult Index(<span style="color:Blue;">long</span> id)
{
...
}
</pre></div><br />With this additional code you can use MVC.Controller.Action() to generate links, regardless if the action<br />is Async or not, however, you cannot mix and match with the same method names, all must be either Async or not. <br />
<h2>3. Tweaking the behavior of T4MVC</h2>
When you download T4MVC, you not only get the main T4MVC.tt template, but you also get a file named T4MVC.tt.hooks.t4, which can conatin some extensibility hooks. In addition to that, T4MVC supports a T4MVC.tt.settings.xml. This file will be created with some defaults the first time T4MVC gets to run. This file contains various knobs that you can use to tweak the code generated by T4MVC. This section describes the various switches:<br />
<h3>3.1 Using Model &#39;unbinders&#39;</h3>
By default T4MVC basically performs a .ToString() operation when adding objects to URLs (route values). It works great for value types and strings, but usually fails at complex objects. Model unbinders let you inject your custom logic into the process of serializing model to URL parameters. Say, you have the following action:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">public</span> ActionResult Profile(User user) {}
<span style="color:Blue;">public</span> <span style="color:Blue;">class</span> User {
<span style="color:Blue;">public</span> <span style="color:Blue;">int</span> Id { <span style="color:Blue;">get</span>; <span style="color:Blue;">set</span>; }
<span style="color:Blue;">public</span> <span style="color:Blue;">string</span> Login { <span style="color:Blue;">get</span>; <span style="color:Blue;">set</span>; }
}
</pre></div>Here&#39;s the typical result of generating an URL for that action with T4MVC:<br /><div style="color:Black;background-color:White;"><pre>
@Url.Action(MVC.Home.Profile(<span style="color:Blue;">new</span> User {Id = 1})); <span style="color:Green;">// -&gt; /Home/Profile?user=Mvc.HomeController.User</span>
</pre></div>If you&#39;d like to get an URL like /Home/Profile?user=1 you could write a model unbinder, which should implement either IModelUnbinder or IModelUnbinder&lt;T&gt;:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">public</span> <span style="color:Blue;">class</span> UserUnbinder : IModelUnbinder&lt;User&gt;
{
<span style="color:Blue;">public</span> <span style="color:Blue;">void</span> UnbindModel(RouteValueDictionary routeValueDictionary, <span style="color:Blue;">string</span> routeName, User user)
{
<span style="color:Blue;">if</span> (user != <span style="color:Blue;">null</span>)
routeValueDictionary.Add(routeName, user.Id);
}
}
</pre></div>and then inject it to T4MVC in Application_Start: <br /><div style="color:Black;background-color:White;"><pre>
ModelUnbinderHelpers.ModelUnbinders.Add(<span style="color:Blue;">new</span> UserUnbinder());
</pre></div>After that you&#39;ll get exactly what described above:<br /><div style="color:Black;background-color:White;"><pre>
@Url.Action(MVC.Home.Profile(<span style="color:Blue;">new</span> User {Id = 1})); <span style="color:Green;">// -&gt; /Home/Profile?user=1</span>
</pre></div>If you want T4MVC to serialize all the properties of the certain type to url parameters, built-in PropertiesUnbinder could help you do this:<br /><div style="color:Black;background-color:White;"><pre>
ModelUnbinderHelpers.ModelUnbinders.Add(<span style="color:Blue;">typeof</span>(User), <span style="color:Blue;">new</span> PropertiesUnbinder());
</pre></div>In this case you&#39;ll get:<br /><div style="color:Black;background-color:White;"><pre>
@Url.Action(MVC.Home.Profile(<span style="color:Blue;">new</span> User {Id = 1, Login = <span style="color:#A31515;">&quot;test&quot;</span> })); <span style="color:Green;">// -&gt; /Home/Profile?user.Id=1&amp;user.Login=test</span>
</pre></div>which will gently suit the default MVC model binder. T4MVC searches for unbinders through the base types and interfaces that the object implements.<br />
<h3>3.2 XML Settings File</h3>
The T4MVC.tt.settings.t4 file have been replaced with a more &quot;upgrade friendly&quot; XML configuration file. This file is automatically generated/updated by the template when it is run, so the file will always reflect the current options and settings for the template. This new structure means that future upgrade to the template will not cause manual merging of your settings into a new settings, or for the template to break because a new setting was added. Your modified existing T4MVC.tt.settings.t4 will be left behind after upgrade and will not longer be used, however, the template cannot import your settings so you will have to edit the new XML file and copy them over. Once done you can safely delete the settings.t4 file.<br /><br />Two methods from the old settings file were moved into a new T4MVC.tt.hooks.t4 file, AddTimestampToStaticLink and RenderAdditionalCode. Neither of these tweaks could be properly represented in an XML file since they are adjustments to the template its self. Changes to this file should be rare and documented when done, so during upgrades you can generally ignore replacement errors if you have customized its contents.<br />
<h3>3.3 Miscellaneous tweaks</h3>
<h4>Set SplitIntoMultipleFiles to false to generate a single file with everything</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!-- If true,the template output will be split into multiple files. --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">SplitIntoMultipleFiles</span><span style="color:Blue;">&gt;</span>true<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">SplitIntoMultipleFiles</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Use HelpersPrefix to change the MVC prefix of the generated classes</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!-- The prefix used for things like MVC.Dinners.Name and MVC.Dinners.Delete(Model.DinnerID) --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">HelpersPrefix</span><span style="color:Blue;">&gt;</span>MVC<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">HelpersPrefix</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Use ControllersFolder and ViewsRootFolder to rename the Controllers and Views folders</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!-- The folder under the project that contains the controllers --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">ControllersFolder</span><span style="color:Blue;">&gt;</span>Controllers<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">ControllersFolder</span><span style="color:Blue;">&gt;</span>
<span style="color:Green;">&lt;!-- The folder under the project that contains the views --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">ViewsRootFolder</span><span style="color:Blue;">&gt;</span>Views<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">ViewsRootFolder</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Use LinksNamespace the generated links&#39; namespace</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!-- The namespace that the links are generated in (e.g. &quot;Links&quot;, as in Links.Content.nerd_jpg) --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">LinksNamespace</span><span style="color:Blue;">&gt;</span>Links<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">LinksNamespace</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Use StaticFilesFolders to tweak the list of folders from which links are generated</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!-- Folders containing static files for which links are generated (e.g. Links.Scripts.Map_js) --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">StaticFilesFolders</span><span style="color:Blue;">&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">FileFolder</span><span style="color:Blue;">&gt;</span>Scripts<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">FileFolder</span><span style="color:Blue;">&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">FileFolder</span><span style="color:Blue;">&gt;</span>Content<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">FileFolder</span><span style="color:Blue;">&gt;</span>
<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">StaticFilesFolders</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Use GenerateParamsAsConstantsForActionMethods to generate constants instead of static classes for parameter names. This lets you use them in attributes.</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!--The true the parameter name class will be generated as constants (allowing use in attributes). This is the suggested way to do this. However, if you used T4MVC Params before and referenced them outside the controller, your references will need to change from MVC.User.MyActionParams to MVC.UserController.MyActionParams. --&gt;</span> <span style="color:Blue;">&lt;</span><span style="color:#A31515;">GenerateParamsAsConstantsForActionMethods</span><span style="color:Blue;">&gt;</span>True<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">GenerateParamsAsConstantsForActionMethods</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Customize Action values</h4>
The generated T4MVC_<a href="https://t4mvc.codeplex.com/wikipage?title=ControllerClass&referringTitle=Documentation">ControllerClass</a> classes are now partial classes so you can extend and customize the values returned from MVC.Controller.Action() calls. In this class, for each overridden method a partial method call is available, if you implement that partial you have the ability to modify the the action values before they are returned.<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">partial</span> T4MVC_SomeController
{
<span style="color:Blue;">partial</span> <span style="color:Blue;">void</span> SomeAction(T4MVC_System_Web_Mvc_ActionResult callInfo)
{
callInfo.RouteValues[<span style="color:#A31515;">&quot;other&quot;</span>] = 1;
}
}
</pre></div><br />Also, the parameterless methods are not virtual so they can be overridden in the partial as well.<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">partial</span> T4MVC_SomeController
{
<span style="color:Blue;">public</span> <span style="color:Blue;">override</span> ActionResult SomeAction()
{
<span style="color:Blue;">var</span> callInfo = <span style="color:Blue;">base</span>.SomeAction();
callInfo.GetRouteValueDictionary()[<span style="color:#A31515;">&quot;other&quot;</span>] = 1;
<span style="color:Blue;">return</span> callInfo;
}
}
</pre></div>
<h2>4. Related resources</h2>
David Ebbo has written a series of <a href="http://blogs.msdn.com/davidebb/archive/tags/T4MVC/default.aspx">blog posts on T4MVC</a><br />Scott Hanselman also <a href="http://www.hanselman.com/blog/TheWeeklySourceCode43ASPNETMVCAndT4AndNerdDinner.aspx">blogged about it here</a></div><div class="ClearBoth"></div>cribeFri, 28 Mar 2014 13:08:15 GMTUpdated Wiki: Documentation 20140328010815PUpdated Wiki: Documentationhttps://t4mvc.codeplex.com/documentation?version=16<div class="wikidoc"><h1>T4MVC Documentation page</h1>
<h2>1. Introduction</h2>
T4MVC is a T4 template for ASP.NET MVC apps that creates strongly typed helpers that eliminate the use of literal strings when referring the controllers, actions and views. It helps make your MVC code much more maintainable, and gives you intellisense where you normally would not have any. It was started by <a href="http://twitter.com/#!/davidebbo">David Ebbo</a> as a little blog post thing, and has since gained many new features based on great community feedback.<br /><br />T4MVC runs in Visual Studio 2010, 2012 and 2013, and supports ASP.NET MVC 4.0 and 5.0 (older MVCs may work but are untested).<br /><br />To use it, simply install the T4MVC package using NuGet. You will get T4MVC.tt in your project, and will instantly see a number of files get created in Visual Studio under it.<br /><br />The code in those generated files enable a whole range of scenarios, all relating to replacing unwanted literal strings with a strongly typed alternative. The documentation below gives a complete list of those scenarios.<br />
<h3>1.1 It&#39;s still just standard MVC under the cover</h3>
One key concept to understand about T4MVC is that it is just a thin layer over MVC. e.g. while it provides strong typing, in the end it&#39;s just putting values in a dictionary, and using standard MVC to generate the routes.<br /><br />One thing I often suggest when people have questions is to first figure out how they would do things without T4MVC. If you have no idea how it would work, or think it may not be possible at all, then you are probably expecting too much of T4MVC! Generally, it will not do anything that MVC does not support.<br />
<h2>2. Scenarios</h2>
Instead of a formal documentation, we&#39;ll just demonstrate by example the various scenarios where T4MVC helps improve your code. The examples are shown in a before/after format to outline the change that is made.<br /><br />Note: a lot of the examples given below are based on the <a href="http://nerddinner.codeplex.com/">Nerd Dinner</a> sample MVC application. <br />
<h3>2.1 Using View Name constants</h3>
<br />Any time you would use a literal string to refer to a view, T4MVC gives you a strongly typed alternative. e.g. suppose you have this code in a view:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;% Html.RenderPartial(<span style="color:#A31515;">&quot;DinnerForm&quot;</span>); %&gt;
</pre></div>This ugly “DinnerForm” literal string needs to go! Instead, you can now write:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;% Html.RenderPartial(MVC.Dinners.Views.DinnerForm); %&gt;
</pre></div><br />When you need to use a view name inside a controller, things get even easier. e.g. you can replace:<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> View(<span style="color:#A31515;">&quot;InvalidOwner&quot;</span>);
</pre></div>by<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> View(Views.InvalidOwner);
</pre></div><br />Note how you can omit the MVC.Dinners prefix, since this is implied by the fact that the code lives in the Dinners controller.<br />
<h4>2.1.1 Non-Qualified View Name Constants</h4>
Non-qualified view names can be used via the ViewNames property underneath the Views property. Non-qualified views are usefull for allowing overloading and are needed by certain setups, e.g. Spark.<br /><br />Traditional &quot;Magic String&quot; Non-Qualified view:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> View(<span style="color:#A31515;">&quot;Index&quot;</span>);
</pre></div><br />T4MVC Non-Qualified view:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> View(Views.ViewNames.Index);
</pre></div>
<h3>2.2 Referring to controller actions</h3>
<br />Many MVC APIs follow a pattern where you need to pass three pieces of information in order to refer to a controller action:<br />
<ol><li>the controller name (often implied when dealing with the current controller)</li>
<li>the action method name</li>
<li>the parameters to be passed to the action method</li></ol>
<br />All of this is typically done by passing literal strings for #1 and #2, and an anonymous object for #3, e.g.<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, <span style="color:#A31515;">&quot;Delete&quot;</span>, <span style="color:#A31515;">&quot;Dinners&quot;</span>, <span style="color:Blue;">new</span> { id = Model.DinnerID }, <span style="color:Blue;">null</span>)%&gt;
</pre></div>Here, &quot;Delete&quot; and &quot;Dinners&quot; are clear literal strings that we&#39;d like to get rid of. But that&#39;s not all, as the paramter name &#39;id&#39; is as much of a problem as those other two. Even though it doesn’t look like a literal string, it very much is one in disguise. Don’t let those anonymous objects fool you!<br /><br />With T4MVC, you would instead write:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Dinners.Delete(Model.DinnerID))%&gt;
</pre></div>Basically, we got rid of the three unwanted literal strings (“Delete”, &quot;Dinners&quot; and “Id”), and replaced them by a very natural looking method call to the controller action. Of course, this is not really calling the controller action, which would be very wrong here. But it’s capturing the essence of method call, and turning it into the right route values.<br /><br />One other great benefit of this approach is that you get full intellisense while you type this line. In fact, you even get full refactoring support if you use a tool like resharper which supports aspx refactoring!<br />
<h4>Adding additional route parameters</h4>
In some situation, you may need to add extra values to the route that don’t exist in the action method. You can do it as follows:<br /><br /><div style="color:Black;background-color:White;"><pre>
Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Dinners.Delete(Model.DinnerID)
.AddRouteValue(<span style="color:#A31515;">&quot;foo&quot;</span>, 17))
</pre></div><br />You can add multiple values this way using a fluent approach, e.g.<br /><br /><div style="color:Black;background-color:White;"><pre>
Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Dinners.Delete(Model.DinnerID)
.AddRouteValue(<span style="color:#A31515;">&quot;foo&quot;</span>, 17)
.AddRouteValue(<span style="color:#A31515;">&quot;bar&quot;</span>, <span style="color:#A31515;">&quot;abc&quot;</span>))
</pre></div><br />As an alternative for adding multiple values, you can write:<br /><br /><div style="color:Black;background-color:White;"><pre>
Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Dinners.Delete(Model.DinnerID)
.AddRouteValues(<span style="color:Blue;">new</span> { foo = 17, bar = <span style="color:#A31515;">&quot;abc&quot;</span>}))
</pre></div><br />Note that in some cases, you may want to omit the action method parameters from the route, possibly because they are meant to come from form data and not from the URL. For those cases, you can always use the parameter-less override that T4MVC generates (that part is not new), e.g.<br /><br /><div style="color:Black;background-color:White;"><pre>
Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Dinners.Delete()
.AddRouteValues(<span style="color:Blue;">new</span> { foo = 17, bar = <span style="color:#A31515;">&quot;abc&quot;</span>}))
</pre></div><br />Now suppose you want to add all the current query string values to the route values produced by T4MVC. You can use the AddRouteValues() overload that takes a NameValueCollection. e.g.<br /><br /><div style="color:Black;background-color:White;"><pre>
RedirectToAction(MVC.Home.MyAction().AddRouteValues(Request.QueryString));
</pre></div><br />This adds to the existing set of AddRouteValue/AddRouteValues fluent APIs to make it easier to deal with all kind different situations.<br /><br />The nice thing about this fluent approach is that it doesn’t require adding overloads to all the T4MVC helpers (e.g. Html.ActionLink is this case) to take in the extra route values. Instead, it automatically applies to any method that uses the T4MVC pattern.<br /><br />The general pattern of making a pseudo-call to a controller action is used is many places in T4MVC:<br />
<h4>2.2.1 Html.ActionLink</h4>
Ok, we just covered that one above.<br />
<h4>2.2.2 Url.Action</h4>
<div style="color:Black;background-color:White;"><pre>
&lt;%= Url.Action(MVC.Dinners.Delete(Model.DinnerID))%&gt;
</pre></div>
<h4>2.2.2a Url.JavaScriptReplacableUrl</h4>
Two use cases for the above. <br /><br /><b>1st Use Case:</b><br />If you have an action you want to call from javascript like this:<br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Url.Action(MVC.Dinners.Display(Model.DinnerID))%&gt;
</pre></div>Odds are you want to get the Model.DinnerID from a javascript variable. So you end up with<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">var</span> myUrl=&lt;%= Url.Action(MVC.Dinners.Display())%&gt;
<span style="color:Green;">//myUrl will be /Dinners/Display</span>
<span style="color:Blue;">var</span> myFinalUrl=myUrl+<span style="color:#A31515;">&quot;/&quot;</span>+dinnerId; <span style="color:Green;">///Dinners/Display/12</span>
<span style="color:Green;">//or does it look like </span>
<span style="color:Blue;">var</span> myFinalUrl=myUrl+<span style="color:#A31515;">&quot;?dinnerID&quot;</span>+dinnerId; <span style="color:Green;">///Dinners/Display?dinnerId=12</span>
</pre></div>The issue is you are not sure how to compose the URL and if it changes, this will silently break.<br /><br /><b>2nd Use Case:</b><br />For the above action in your routing table you created a route like:<br />&quot;Dinners/Display/{dinnerId}&quot; - and you constrain dinnerId to be an integer larger than zero.<br /><br />Now, if you do the same scenario above:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">var</span> myUrl=&lt;%= Url.Action(MVC.Dinners.Display())%&gt;
</pre></div>The route will not be found - because there is not a route match (since dinnerId was not provided).<br /><br /><b>JavaScriptReplacableUrl solves both of these issues</b><br />No matter which use case, you define a specific route for the action (constrained parameters or not)<br />In the routing table you add:<br />&quot;Dinners/Display/{dinnerId}&quot; - (constrain dinnerId if you want)<br /><b>Note: You must define a specific route for JavaScriptReplacableUrl to work like this - it cannot work with &#39;default routes&#39;. If it cannot find a matching route it behaves like Url.Action().</b><br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">var</span> myUrl=&lt;%= Url.JavaScriptReplacableUrl(MVC.Dinners.Display())%&gt;
<span style="color:Green;">//myUrl will be Dinners/Display/{dinnerId} </span>
<span style="color:Blue;">var</span> myFinalUrl=myUrl.replace(<span style="color:#A31515;">&quot;{dinnerId}&quot;</span>, dinnerId); <span style="color:Green;">//this will have whatever route shape you defined in routing table!</span>
</pre></div><br />Note you can use the parameter name constants from T4MVC (and that will give you compile time checking for parameter name changes:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">var</span> myFinalUrl=myUrl.replace(<span style="color:#A31515;">&quot;{&quot;</span>+MVC.Dinners.DisplayParams.dinnerId+<span style="color:#A31515;">&quot;}&quot;</span>, dinnerId); <span style="color:Green;">//this will have whatever route shape you defined </span>
</pre></div><br />
<h4>2.2.3 Ajax.ActionLink</h4>
<div style="color:Black;background-color:White;"><pre>
&lt;%= Ajax.ActionLink( <span style="color:#A31515;">&quot;RSVP for this event&quot;</span>,
<span style="color:#A31515;">&quot;Register&quot;</span>, <span style="color:#A31515;">&quot;RSVP&quot;</span>,
<span style="color:Blue;">new</span> { id=Model.DinnerID },
<span style="color:Blue;">new</span> AjaxOptions { UpdateTargetId=<span style="color:#A31515;">&quot;rsvpmsg&quot;</span>, OnSuccess=<span style="color:#A31515;">&quot;AnimateRSVPMessage&quot;</span> }) %&gt;
</pre></div>becomes<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Ajax.ActionLink( <span style="color:#A31515;">&quot;RSVP for this event&quot;</span>,
MVC.RSVP.Register(Model.DinnerID),
<span style="color:Blue;">new</span> AjaxOptions { UpdateTargetId=<span style="color:#A31515;">&quot;rsvpmsg&quot;</span>, OnSuccess=<span style="color:#A31515;">&quot;AnimateRSVPMessage&quot;</span> }) %&gt;
</pre></div>
<h4>2.2.4 RedirectToAction (in controller code)</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> RedirectToAction(<span style="color:#A31515;">&quot;Details&quot;</span>, <span style="color:Blue;">new</span> { id = dinner.DinnerID });
</pre></div>becomes<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> RedirectToAction(MVC.Dinners.Details(dinner.DinnerID));
</pre></div>
<h4>2.2.5 routes.MapRoute (typically in global.asax)</h4>
<div style="color:Black;background-color:White;"><pre>
routes.MapRoute(
<span style="color:#A31515;">&quot;UpcomingDinners&quot;</span>,
<span style="color:#A31515;">&quot;Dinners/Page/{page}&quot;</span>,
<span style="color:Blue;">new</span> { controller = <span style="color:#A31515;">&quot;Dinners&quot;</span>, action = <span style="color:#A31515;">&quot;Index&quot;</span> }
);
</pre></div>becomes<br /><br /><div style="color:Black;background-color:White;"><pre>
routes.MapRoute(
<span style="color:#A31515;">&quot;UpcomingDinners&quot;</span>,
<span style="color:#A31515;">&quot;Dinners/Page/{page}&quot;</span>,
MVC.Dinners.Index(<span style="color:Blue;">null</span>)
);
</pre></div>
<h4>2.2.6 Html.BeginForm</h4>
Essentially, it’s the same support as ActionLink() but for the BeginForm() method. But note that because form posts typically pass most of the data via the form and not the URL, BeginForm() is trickier to use correctly than the other methods.<br /><br />Here is how you might use this:<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">using</span> (Html.BeginForm(MVC.Account.LogOn(), FormMethod.Post)) { ... }
</pre></div>Or if the action method takes parameters, you would pass them in the call. However, when you do this you need to make sure that you aren’t also trying to pass those same parameters via the form (e.g. using a text box).<br /><br />Generally, the rule of thumb is that this support works well when you’re dealing with forms where the Action method signature exactly matches the form URL.<br />
<h4>2.2.7 Html.RenderAction and Html.Action (only in MVC 2 or newer)</h4>
These are new to MVC 2. See Phil Haack&#39;s <a href="http://haacked.com/archive/2009/11/18/aspnetmvc2-render-action.aspx">post</a> about them for details.<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.Action(<span style="color:#A31515;">&quot;Menu&quot;</span>, <span style="color:Blue;">new</span> { options = <span style="color:Blue;">new</span> MenuOptions { Width=400, Height=500} })%&gt;
</pre></div>becomes<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.Action(MVC.Home.Menu(<span style="color:Blue;">new</span> MenuOptions { Width=400, Height=500})); %&gt;
</pre></div>Same deal for Html.RenderAction.<br />
<h3>2.3. Use constants to refer to area, controller, action and parameter names</h3>
<h4>2.3.1 Area name constants</h4>
<div style="color:Black;background-color:White;"><pre>
MVC.CoolArea.Name
</pre></div>
<h4>2.3.2 Controller name constants</h4>
<div style="color:Black;background-color:White;"><pre>
MVC.Home.Name
</pre></div>
<h4>2.3.3 Action name constants</h4>
<div style="color:Black;background-color:White;"><pre>
MVC.Home.ActionNames.Index
</pre></div>
<h4>2.3.4 Parameter name constants</h4>
Assuming a Home.MyAction action that takes a foo parameter, this evaluates to &quot;foo&quot;:<br /><br /><div style="color:Black;background-color:White;"><pre>
MVC.Home.MyActionParams.foo
</pre></div><br />
<h3>2.4. Strongly typed links to script files and static resources</h3>
<br />T4MVC generates static helpers for your content files and script files. So instead of writing:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;img src=<span style="color:#A31515;">&quot;/Content/nerd.jpg&quot;</span> /&gt;
</pre></div>You can write:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;img src=<span style="color:#A31515;">&quot;&lt;%= Links.Content.nerd_jpg %&gt;&quot;</span> /&gt;
</pre></div>Likewise, instead of<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;script src=<span style="color:#A31515;">&quot;/Scripts/Map.js&quot;</span> type=<span style="color:#A31515;">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;
</pre></div>You can write<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;script src=<span style="color:#A31515;">&quot;&lt;%= Links.Scripts.Map_js %&gt;&quot;</span> type=<span style="color:#A31515;">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;
</pre></div>The obvious benefit is that you’ll get a compile error if you ever move or rename your static resource, so you’ll catch it earlier.<br /><br />Another benefit is that you get a more versatile reference. When you write src=&quot;/Content/nerd.jpg&quot;, your app will only work when it’s deployed at the root of the site. But when you use the helper, it executes some server side logic that makes sure your reference is correct wherever your site is rooted. It does this by calling VirtualPathUtility.ToAbsolute(&quot;~/Content/nerd.jpg&quot;).<br /><br />One unfortunate thing is that for some reason, VS doesn’t support intellisense in the view for parameter values. As a workaround, you can type it outside of the tag to get intellisense and then copy it there.<br /><br /><b>Important note</b>: if you see strange links getting generated in your &lt;head&gt; tag, you just need to remove the runat=&quot;server&quot; from it.<br />
<h4> Support for MVC&#39;s script and style bundles</h4>
Starting from MVC4, one can define &quot;bundles&quot; of scripts and stylesheets which are automatically combined and minified. However, magic strings are used to define the resource URLs. To eliminate them, follow steps 1 to 3 below.<br /><br />1. Add the following to your own code, which will extend T4MVC&#39;s static partial &quot;Links.bundles.scripts&quot; and &quot;Links.bundles.styles&quot; classes:<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">namespace</span> Links {
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">partial</span> <span style="color:Blue;">class</span> bundles {
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">partial</span> <span style="color:Blue;">class</span> scripts {
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">readonly</span> <span style="color:Blue;">string</span> jquery = <span style="color:#A31515;">&quot;~/scripts/jquery&quot;</span>;
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">readonly</span> <span style="color:Blue;">string</span> jqueryui = <span style="color:#A31515;">&quot;~/scripts/jqueryui&quot;</span>;
}
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">partial</span> <span style="color:Blue;">class</span> styles {
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">readonly</span> <span style="color:Blue;">string</span> bootstrap = <span style="color:#A31515;">&quot;~/styles/boostrap&quot;</span>;
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">readonly</span> <span style="color:Blue;">string</span> theme = <span style="color:#A31515;">&quot;~/styles/theme&quot;</span>;
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">readonly</span> <span style="color:Blue;">string</span> common = <span style="color:#A31515;">&quot;~/styles/common&quot;</span>;
}
}
}
</pre></div><br />Notice how the magic strings are now defined in one place only, and are thus easy to maintain.<br /><br />2. Use the following to add your bundles to the runtime:<br /><br /><div style="color:Black;background-color:White;"><pre>
bundles.Add(<span style="color:Blue;">new</span> ScriptBundle(Links.bundles.scripts.jquery).Include(<span style="color:#A31515;">&quot;~/scripts/jquery-{version}.js&quot;</span>));
bundles.Add(<span style="color:Blue;">new</span> StyleBundle(Links.bundles.styles.bootstrap).Include(<span style="color:#A31515;">&quot;~/styles/bootstrap*.css&quot;</span>));
</pre></div><br />3. Use the following to use a bundle in a cshtml layout/view:<br /><br /><div style="color:Black;background-color:White;"><pre>
@Scripts.Render(Links.bundles.scripts.jquery)
@Styles.Render(Links.bundles.scripts.bootstrap)
</pre></div>
<h4>Support for Minified Javascript files</h4>
Minified javascript files are alternate version of the files that makes them as small as possible, but using various strategies like removing white space. e.g. in an MVC application’s Scripts folder, you’ll typically see both jquery-1.3.2.js and jquery-1.3.2.min.js. Usually, you want to use the minified version at deployment time (to make your site load faster), but the regular version at development time, so you can more easily debug into it.<br /><br />T4MVC makes it automatic to use one vs. the other depending on the context. e.g. suppose you have:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;script src=<span style="color:#A31515;">&quot;&lt;%= Links.Scripts.jquery_1_2_6_js %&gt;&quot;</span> type=<span style="color:#A31515;">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;
</pre></div>You don’t need to change anything to this line, but the token jquery_1_2_6_js will automatically point to either jquery-1.3.2.js or jquery-1.3.2.min.js depending on whether you’re running in production. How does it know whether you’re in production? It calls a method defined in T4MVC.tt.hooks.t4 which makes the decision. By default, it looks at whether debugging is enabled:<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">// Logic to determine if the app is running in production or dev environment</span>
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">bool</span> IsProduction() {
<span style="color:Blue;">return</span> (HttpContext.Current != <span style="color:Blue;">null</span> &amp;&amp; !HttpContext.Current.IsDebuggingEnabled);
}
</pre></div><br />But you can easily change this logic if you have a different way of determining ‘production’.<br />
<h3>2.5 Using T4MVC with &quot;Areas&quot;</h3>
<br />One of MVC 2&#39;s major new features is the support for breaking up a large application into &quot;Areas&quot;. This works by following a structure that looks like:<br />
<ul><li>Root folder
<ul><li>Areas
<ul><li>NerdDinner
<ul><li>Models</li>
<li>Views</li>
<li>Controllers</li></ul></li>
<li>Wiki
<ul><li>Models</li>
<li>Views</li>
<li>Controllers</li></ul></li></ul></li></ul></li></ul>
<br />T4MVC automatically works with your areas and makes them available in its object model. Here is an example:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.NerdDinner.Dinners.Delete(Model.DinnerID))%&gt;
</pre></div>Notice how we refered to the controller as MVC.<b>NerdDinner</b>.Dinners. Note that if you happen to have a top level controller with the same name as the area, this naming pattern would cause a conflict. In that case, T4MVC appends &#39;Area&#39; at the end of the area name to avoid the conflict. e.g. If you have both a Home area and a Home controller (top level), you would use MVC.Home<b>Area</b>.Hello to refer to the area.<br /><br />Optionally, if you set IncludeAreasToken to true in the settings.xml file, the naming scheme becomes:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Areas.NerdDinner.Dinners.Delete(Model.DinnerID))%&gt;
</pre></div>Note that in this case, the conflict situation discussed above cannot occur. But this comes with a price as you end up with one more segment all the time. I&#39;m debating whether to even keep this mode given that the default mode works quite well.<br />
<h3>2.6 Using T4MVC with AsyncController</h3>
<h4>2.6.1 Enable Asynchronous Action Support</h4>
To enable support for using asynchronous actions in T4MVC you first need to change the SupportAsyncActions setting to true. This is setting is false by default since Async action calls are handled a little differently than normal action calls.<br />
<h4>2.6.1 What it does</h4>
When enabled any AsyncController with an <b>Async action will have two new methods generated in it. The first method is the standard Parameterless Overload and the second one one with the same signature as the </b>Async method but with out the Async extension. In addition, this method returns the standard ActionResult regarless of the possible return types of the *Completed methods. <br /><br />For example the following action in your controller<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">public</span> <span style="color:Blue;">void</span> IndexAsync(<span style="color:Blue;">long</span> id)
{
...
}
<span style="color:Blue;">public</span> JsonResult IndexCompleted(Models.SomeModel model)
{
<span style="color:Blue;">return</span> <span style="color:Blue;">this</span>.JSON(model);
}
</pre></div><br />would cause the following code to be generated by T4MVC<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">public</span> <span style="color:Blue;">virtual</span> ActionResult Index()
{
...
}
<span style="color:Blue;">public</span> <span style="color:Blue;">virtual</span> ActionResult Index(<span style="color:Blue;">long</span> id)
{
...
}
</pre></div><br />With this additional code you can use MVC.Controller.Action() to generate links, regardless if the action<br />is Async or not, however, you cannot mix and match with the same method names, all must be either Async or not. <br />
<h2>3. Tweaking the behavior of T4MVC</h2>
When you download T4MVC, you not only get the main T4MVC.tt template, but you also get a file named T4MVC.tt.hooks.t4, which can conatin some extensibility hooks. In addition to that, T4MVC supports a T4MVC.tt.settings.xml. This file will be created with some defaults the first time T4MVC gets to run. This file contains various knobs that you can use to tweak the code generated by T4MVC. This section describes the various switches:<br />
<h3>3.1 Using Model &#39;unbinders&#39;</h3>
By default T4MVC basically performs a .ToString() operation when adding objects to URLs (route values). It works great for value types and strings, but usually fails at complex objects. Model unbinders let you inject your custom logic into the process of serializing model to URL parameters. Say, you have the following action:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">public</span> ActionResult Profile(User user) {}
<span style="color:Blue;">public</span> <span style="color:Blue;">class</span> User {
<span style="color:Blue;">public</span> <span style="color:Blue;">int</span> Id { <span style="color:Blue;">get</span>; <span style="color:Blue;">set</span>; }
<span style="color:Blue;">public</span> <span style="color:Blue;">string</span> Login { <span style="color:Blue;">get</span>; <span style="color:Blue;">set</span>; }
}
</pre></div>Here&#39;s the typical result of generating an URL for that action with T4MVC:<br /><div style="color:Black;background-color:White;"><pre>
@Url.Action(MVC.Home.Profile(<span style="color:Blue;">new</span> User {Id = 1})); <span style="color:Green;">// -&gt; /Home/Profile?user=Mvc.HomeController.User</span>
</pre></div>If you&#39;d like to get an URL like /Home/Profile?user=1 you could write a model unbinder, which should implement either IModelUnbinder or IModelUnbinder&lt;T&gt;:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">public</span> <span style="color:Blue;">class</span> UserUnbinder : IModelUnbinder&lt;User&gt;
{
<span style="color:Blue;">public</span> <span style="color:Blue;">void</span> UnbindModel(RouteValueDictionary routeValueDictionary, <span style="color:Blue;">string</span> routeName, User user)
{
<span style="color:Blue;">if</span> (user != <span style="color:Blue;">null</span>)
routeValueDictionary.Add(routeName, user.Id);
}
}
</pre></div>and then inject it to T4MVC in Application_Start: <br /><div style="color:Black;background-color:White;"><pre>
ModelUnbinderHelpers.ModelUnbinders.Add(<span style="color:Blue;">new</span> UserUnbinder());
</pre></div>After that you&#39;ll get exactly what described above:<br /><div style="color:Black;background-color:White;"><pre>
@Url.Action(MVC.Home.Profile(<span style="color:Blue;">new</span> User {Id = 1})); <span style="color:Green;">// -&gt; /Home/Profile?user=1</span>
</pre></div>If you want T4MVC to serialize all the properties of the certain type to url parameters, built-in PropertiesUnbinder could help you do this:<br /><div style="color:Black;background-color:White;"><pre>
ModelUnbinderHelpers.ModelUnbinders.Add(<span style="color:Blue;">typeof</span>(User), <span style="color:Blue;">new</span> PropertiesUnbinder());
</pre></div>In this case you&#39;ll get:<br /><div style="color:Black;background-color:White;"><pre>
@Url.Action(MVC.Home.Profile(<span style="color:Blue;">new</span> User {Id = 1, Login = <span style="color:#A31515;">&quot;test&quot;</span> })); <span style="color:Green;">// -&gt; /Home/Profile?user.Id=1&amp;user.Login=test</span>
</pre></div>which will gently suit the default MVC model binder. T4MVC searches for unbinders through the base types and interfaces that the object implements.<br />
<h3>3.2 XML Settings File</h3>
The T4MVC.tt.settings.t4 file have been replaced with a more &quot;upgrade friendly&quot; XML configuration file. This file is automatically generated/updated by the template when it is run, so the file will always reflect the current options and settings for the template. This new structure means that future upgrade to the template will not cause manual merging of your settings into a new settings, or for the template to break because a new setting was added. Your modified existing T4MVC.tt.settings.t4 will be left behind after upgrade and will not longer be used, however, the template cannot import your settings so you will have to edit the new XML file and copy them over. Once done you can safely delete the settings.t4 file.<br /><br />Two methods from the old settings file were moved into a new T4MVC.tt.hooks.t4 file, AddTimestampToStaticLink and RenderAdditionalCode. Neither of these tweaks could be properly represented in an XML file since they are adjustments to the template its self. Changes to this file should be rare and documented when done, so during upgrades you can generally ignore replacement errors if you have customized its contents.<br />
<h3>3.3 Miscellaneous tweaks</h3>
<h4>Set SplitIntoMultipleFiles to false to generate a single file with everything</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!-- If true,the template output will be split into multiple files. --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">SplitIntoMultipleFiles</span><span style="color:Blue;">&gt;</span>true<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">SplitIntoMultipleFiles</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Use HelpersPrefix to change the MVC prefix of the generated classes</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!-- The prefix used for things like MVC.Dinners.Name and MVC.Dinners.Delete(Model.DinnerID) --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">HelpersPrefix</span><span style="color:Blue;">&gt;</span>MVC<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">HelpersPrefix</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Use ControllersFolder and ViewsRootFolder to rename the Controllers and Views folders</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!-- The folder under the project that contains the controllers --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">ControllersFolder</span><span style="color:Blue;">&gt;</span>Controllers<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">ControllersFolder</span><span style="color:Blue;">&gt;</span>
<span style="color:Green;">&lt;!-- The folder under the project that contains the views --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">ViewsRootFolder</span><span style="color:Blue;">&gt;</span>Views<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">ViewsRootFolder</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Use LinksNamespace the generated links&#39; namespace</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!-- The namespace that the links are generated in (e.g. &quot;Links&quot;, as in Links.Content.nerd_jpg) --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">LinksNamespace</span><span style="color:Blue;">&gt;</span>Links<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">LinksNamespace</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Use StaticFilesFolders to tweak the list of folders from which links are generated</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!-- Folders containing static files for which links are generated (e.g. Links.Scripts.Map_js) --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">StaticFilesFolders</span><span style="color:Blue;">&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">FileFolder</span><span style="color:Blue;">&gt;</span>Scripts<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">FileFolder</span><span style="color:Blue;">&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">FileFolder</span><span style="color:Blue;">&gt;</span>Content<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">FileFolder</span><span style="color:Blue;">&gt;</span>
<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">StaticFilesFolders</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Use GenerateParamsAsConstantsForActionMethods to generate constants instead of static classes for parameter names. This lets you use them in attributes.</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!--The true the parameter name class will be generated as constants (allowing use in attributes). This is the suggested way to do this. However, if you used T4MVC Params before and referenced them outside the controller, your references will need to change from MVC.User.MyActionParams to MVC.UserController.MyActionParams. --&gt;</span> <span style="color:Blue;">&lt;</span><span style="color:#A31515;">GenerateParamsAsConstantsForActionMethods</span><span style="color:Blue;">&gt;</span>True<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">GenerateParamsAsConstantsForActionMethods</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Customize Action values</h4>
The generated T4MVC_<a href="https://t4mvc.codeplex.com/wikipage?title=ControllerClass&referringTitle=Documentation">ControllerClass</a> classes are now partial classes so you can extend and customize the values returned from MVC.Controller.Action() calls. In this class, for each overridden method a partial method call is available, if you implement that partial you have the ability to modify the the action values before they are returned.<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">partial</span> T4MVC_SomeController
{
<span style="color:Blue;">partial</span> <span style="color:Blue;">void</span> SomeAction(T4MVC_System_Web_Mvc_ActionResult callInfo)
{
callInfo.RouteValues[<span style="color:#A31515;">&quot;other&quot;</span>] = 1;
}
}
</pre></div><br />Also, the parameterless methods are not virtual so they can be overridden in the partial as well.<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">partial</span> T4MVC_SomeController
{
<span style="color:Blue;">public</span> <span style="color:Blue;">override</span> ActionResult SomeAction()
{
<span style="color:Blue;">var</span> callInfo = <span style="color:Blue;">base</span>.SomeAction();
callInfo.GetRouteValueDictionary()[<span style="color:#A31515;">&quot;other&quot;</span>] = 1;
<span style="color:Blue;">return</span> callInfo;
}
}
</pre></div>
<h2>4. Related resources</h2>
David Ebbo has written a series of <a href="http://blogs.msdn.com/davidebb/archive/tags/T4MVC/default.aspx">blog posts on T4MVC</a><br />Scott Hanselman also <a href="http://www.hanselman.com/blog/TheWeeklySourceCode43ASPNETMVCAndT4AndNerdDinner.aspx">blogged about it here</a></div><div class="ClearBoth"></div>davidebboSat, 08 Mar 2014 06:12:12 GMTUpdated Wiki: Documentation 20140308061212AUpdated Wiki: T4MVC_Historyhttps://t4mvc.codeplex.com/wikipage?title=T4MVC_History&version=34<div class="wikidoc"><h1>T4MVC change history</h1>
<h3>3.8.0 (3-2-2014)</h3>
<ul><li>Add RedirectToAction overload that takes Task&lt;ActionResult&gt;. <a href="https://t4mvc.codeplex.com/discussions/535761">https://t4mvc.codeplex.com/discussions/535761</a></li>
<li>Fix JavaScriptReplacableUrl to correctly use ~/. <a href="https://t4mvc.codeplex.com/discussions/405911">https://t4mvc.codeplex.com/discussions/405911</a></li>
<li>Rename JavaScriptReplacableUrl to JavaScriptReplaceableUrl. I know, small breaking change, but not widely used. Live with it!</li></ul>
<h3>3.7.7 (2-23-2014)</h3>
<ul><li>Fix signing issue in 3.7.6. <a href="https://t4mvc.codeplex.com/discussions/533445">https://t4mvc.codeplex.com/discussions/533445</a></li></ul>
<h3>3.7.6 (2-20-2014)</h3>
<ul><li>Allow AddRouteValues to override values. <a href="https://t4mvc.codeplex.com/workitem/39">https://t4mvc.codeplex.com/workitem/39</a></li></ul>
<h3>3.7.5 (1-28-2014)</h3>
<ul><li>Make statuc MVC class partial. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/garyhunt/T4MVCpartial/contribution/6116">https://t4mvc.codeplex.com/SourceControl/network/forks/garyhunt/T4MVCpartial/contribution/6116</a></li>
<li>Mark action overloads as NonAction. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/garyhunt/T4MVCNonAction/contribution/6118">https://t4mvc.codeplex.com/SourceControl/network/forks/garyhunt/T4MVCNonAction/contribution/6118</a></li></ul>
<h3>3.7.4 (9-19-2013)</h3>
<ul><li>Set buildaction of t4 files to none. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/duncans/T4MVC/contribution/5356">https://t4mvc.codeplex.com/SourceControl/network/forks/duncans/T4MVC/contribution/5356</a></li></ul>
<h3>3.7.3 (8-09-2013)</h3>
<ul><li>Fix issue 23 - support for &#39;async Task&lt;ActionResult&gt;&#39; methods. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/5154">https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/5154</a></li></ul>
<h3>3.7.2 (8-07-2013)</h3>
<ul><li>Fix abstract view result method generation. <a href="https://t4mvc.codeplex.com/workitem/23">https://t4mvc.codeplex.com/workitem/23</a></li></ul>
<h3>3.7.1 (7-05-2013)</h3>
<ul><li>Fixed bug where AddRouteValue() throws ArgumentException if route value has already been added. <a href="https://t4mvc.codeplex.com/workitem/25">https://t4mvc.codeplex.com/workitem/25</a></li></ul>
<h3>3.7.0 (6-16-2013)</h3>
<ul><li>New AddAllViewsFoldersToStaticFilesFolders flag to include view folder files as static files (off by default) <a href="https://t4mvc.codeplex.com/discussions/445358">https://t4mvc.codeplex.com/discussions/445358</a></li>
<li>New ExcludedViewExtensions setting to not treat certain file extensions as views</li></ul>
<h3>3.6.5 (5-19-2013)</h3>
<ul><li>Use Controller constructor with least number of params. <a href="https://t4mvc.codeplex.com/workitem/22">https://t4mvc.codeplex.com/workitem/22</a></li></ul>
<h3>3.6.4 (5-08-2013)</h3>
<ul><li>Added support for checking files out with Perforce P4VS. <a href="https://t4mvc.codeplex.com/discussions/442992">https://t4mvc.codeplex.com/discussions/442992</a></li></ul>
<h3>3.6.3 (5-08-2013)</h3>
<ul><li>Fix assembly signing</li></ul>
<h3>3.6.2 (5-07-2013)</h3>
<ul><li>Avoid identifier conflict when content file names are similar. <a href="https://t4mvc.codeplex.com/discussions/441214">https://t4mvc.codeplex.com/discussions/441214</a></li></ul>
<h3>3.6.1 (5-03-2013)</h3>
<ul><li>Make actionresult classes partial. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/duncans/T4MVC/contribution/4632">https://t4mvc.codeplex.com/SourceControl/network/forks/duncans/T4MVC/contribution/4632</a></li></ul>
<h3>3.6.0 (4-26-2013)</h3>
<ul><li>Add support for task based actions. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/kev_bite/T4mvcTaskBasedActions/contribution/4564">https://t4mvc.codeplex.com/SourceControl/network/forks/kev_bite/T4mvcTaskBasedActions/contribution/4564</a></li></ul>
<h3>3.5.4 (4-22-2013)</h3>
<ul><li>Make action results internal to avoid cross project conflicts</li></ul>
<h3>3.5.3 (4-19-2013):</h3>
<ul><li>Add support for portable areas without a standard area folder</li></ul>
<h3>3.5.2 (3-07-2013):</h3>
<ul><li>Add support for inherited controller attributes. <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/4194">http://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/4194</a></li></ul>
<h3>3.5.1 (2-25-2013):</h3>
<ul><li>If static files include a timestamp, previously for minified CSS- and JavaScript-files the timestamp was generated by taking the last change time of the unminified file. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4122">https://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4122</a></li></ul>
<h3>3.5.0 (2-08-2013):</h3>
<ul><li>Sign T4MVCExtensions.dll <a href="http://t4mvc.codeplex.com/discussions/432534">http://t4mvc.codeplex.com/discussions/432534</a></li>
<li>Call T4Extension.TimestampString through delegate for unit testing <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4040">http://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4040</a></li></ul>
<h3>3.4.1 (1-31-2013):</h3>
<ul><li>Make T4MVCHelpers internal to avoid cross project conflicts <a href="http://t4mvc.codeplex.com/workitem/17">http://t4mvc.codeplex.com/workitem/17</a></li></ul>
<h3>3.4.0 (1-23-2013):</h3>
<ul><li>Add optional support for async methods <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/3958">https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/3958</a></li>
<li>Generate partial methods to allow custom &quot;overloading&quot; of the return values.</li></ul>
<h3>3.3.0 (1-16-2013):</h3>
<ul><li> Add support for support for model unbinder providers <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/Augi/T4MVCUnbinderProvider/contribution/3879">https://t4mvc.codeplex.com/SourceControl/network/forks/Augi/T4MVCUnbinderProvider/contribution/3879</a></li>
<li> Fix handling of &quot;completed&quot; methods <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/phw/t4mvc/contribution/3922">https://t4mvc.codeplex.com/SourceControl/network/forks/phw/t4mvc/contribution/3922</a></li></ul>
<h3>3.2.1 (12-27-2012):</h3>
<ul><li> Fix issue with VB projects causing exceptions <a href="http://t4mvc.codeplex.com/workitem/7">http://t4mvc.codeplex.com/workitem/7</a></li></ul>
<h3>3.2.0 (12-11-2012):</h3>
<ul><li> Add option to make parameter names constants <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/WayneBrantley/ParameterNamesToConst/contribution/3762">https://t4mvc.codeplex.com/SourceControl/network/forks/WayneBrantley/ParameterNamesToConst/contribution/3762</a></li></ul>
<h3>3.1.0 (12-09-2012):</h3>
<ul><li>Added JavaScriptReplacableUrl helper <a href="http://t4mvc.codeplex.com/discussions/405911">http://t4mvc.codeplex.com/discussions/405911</a></li></ul>
<h3>3.0.3 (11-30-2012):</h3>
<ul><li>Fix to deal with multiple attributes <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/ArtiomChi/t4mvc/contribution/3723">http://t4mvc.codeplex.com/SourceControl/network/forks/ArtiomChi/t4mvc/contribution/3723</a></li></ul>
<h3>3.0.2 (11-17-2012):</h3>
<ul><li>Add support for generic result types <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/ryanrust/T4MVC/contribution/3653">http://t4mvc.codeplex.com/SourceControl/network/forks/ryanrust/T4MVC/contribution/3653</a></li></ul>
<h3>3.0.1 (11-16-2012):</h3>
<ul><li>Fix T4MVC.tt.settings.xml so it only gets generated when needed <a href="https://t4mvc.codeplex.com/discussions/403390">https://t4mvc.codeplex.com/discussions/403390</a></li></ul>
<h3>3.0.0 (11-14-2012):</h3>
<ul><li>Move all the non-dynamic code to a separate T4MVCExtensions.dll assembly</li>
<li>Change generated code brace style to Allman</li>
<li>Added many new RouteLink/BeginRouteForm/RouteUrl helpers</li></ul>
<h3>2.13.0 (10-24-2012):</h3>
<ul><li>Move settings to T4MVC.tt.settings.xml XML file instead of tt file. See doc for details.</li>
<li>Make simple view names available alongside full names, e.g. MVC.Home.Views.SomeView vs MVC.Home.Views.ViewNames.SomeView</li></ul>
<h3>2.12.0 (10-16-2012):</h3>
<ul><li>Add support for static files in nested folders <a href="http://t4mvc.codeplex.com/workitem/6">http://t4mvc.codeplex.com/workitem/6</a></li>
<li>Add MVC 4 bundle starter classes <a href="https://t4mvc.codeplex.com/discussions/399205">https://t4mvc.codeplex.com/discussions/399205</a></li></ul>
<h3>2.11.2 (10-11-2012):</h3>
<ul><li>Removed optional params in ActionLink to support expression trees <a href="http://t4mvc.codeplex.com/workitem/4">http://t4mvc.codeplex.com/workitem/4</a></li>
<li>Change brace style of generated code to Allman</li></ul>
<h3>2.11.1 (10-10-2012):</h3>
<ul><li>Ignore methods that return generic types <a href="http://mvccontrib.codeplex.com/workitem/7178">http://mvccontrib.codeplex.com/workitem/7178</a></li></ul>
<h3>2.11.0 (10-09-2012):</h3>
<ul><li>Corrects the ActionParameters class for overloaded actions to list all parameters and not just the parameters from the first action found.</li></ul>
<h3>2.10.4 (10-05-2012):</h3>
<ul><li>Added attributes so it builds clean under Code Analysis <a href="http://t4mvc.codeplex.com/workitem/10">http://t4mvc.codeplex.com/workitem/10</a></li></ul>
<h3>2.10.3 (09-30-2012):</h3>
<ul><li>Fix crash when querystring contains a null key <a href="http://t4mvc.codeplex.com/discussions/396916">http://t4mvc.codeplex.com/discussions/396916</a></li></ul>
<h3>2.10.2 (09-17-2012):</h3>
<ul><li>Fix UnbindModel to avoid failing on duplicate entries <a href="http://t4mvc.codeplex.com/discussions/394529">http://t4mvc.codeplex.com/discussions/394529</a></li>
<li>Fix ModelUnbinder code generation when SplitIntoMultipleFiles is false <a href="http://t4mvc.codeplex.com/workitem/9">http://t4mvc.codeplex.com/workitem/9</a></li></ul>
<h3>2.10.1 (07-31-2012):</h3>
<ul><li>Fixed default param regression with model unbinder code (<a href="http://stackoverflow.com/questions/11566207/t4mvc-optionalparameter-values-implied-from-current-context/11603897">http://stackoverflow.com/questions/11566207/t4mvc-optionalparameter-values-implied-from-current-context/11603897</a>)</li></ul>
<h3>2.10.0 (07-03-2012):</h3>
<ul><li>Added support for custom model binders (<a href="https://t4mvc.codeplex.com/discussions/357386">https://t4mvc.codeplex.com/discussions/357386</a>)</li>
<li>Fixed unreachable code warning</li></ul>
<h3>2.9.0 (06-22-2012):</h3>
<ul><li>Added support for minified css files (<a href="https://t4mvc.codeplex.com/discussions/360443">https://t4mvc.codeplex.com/discussions/360443</a>)</li>
<li>Replaced improper new RouteValueDictionary usage on htmlAttributes</li></ul>
<h3>2.8.1 (04-12-2012):</h3>
<ul><li>Also default to https for the default (no param) action overload</li>
<li>Make T4MVCHelpers class public so that test code in a different assembly can access it</li></ul>
<h3>2.8 (03-25-2012):</h3>
<ul><li>Generate parameter constants for action methods. e.g. MVC.MyController.MethodParams.someParam</li>
<li>Default to https for Action Methods marked as RequireHttps (either at controller or action level)</li></ul>
<h3>2.7.0 (03-09-2012):</h3>
<ul><li>Removed support for MVC earlier than 3, and for CLR earlier than 4.0</li>
<li>Fix ActionLink to work with MVC4 (<a href="http://mvccontrib.codeplex.com/workitem/7191">http://mvccontrib.codeplex.com/workitem/7191</a>)</li></ul>
<h3>2.6.68 (02-03-2012):</h3>
<ul><li>Ignore static ctors when looking for ctors (<a href="http://mvccontrib.codeplex.com/workitem/7185">http://mvccontrib.codeplex.com/workitem/7185</a>)</li></ul>
<h3>2.6.67 (12-24-2011):</h3>
<ul><li>Restore Actions token that wasn&#39;t obsolete after all. Oops. (<a href="http://stackoverflow.com/questions/8625462/t4mvc-actions-token">http://stackoverflow.com/questions/8625462/t4mvc-actions-token</a>)</li></ul>
<h3>2.6.66 (12-22-2011):</h3>
<ul><li>Disable constant generation in UseLowercaseRoutes mode (<a href="http://stackoverflow.com/questions/8605868/t4mvc-2-6-65-and-uselowercaseroutes-true-error">http://stackoverflow.com/questions/8605868/t4mvc-2-6-65-and-uselowercaseroutes-true-error</a>)</li>
<li>Remove obsolete Actions token (<a href="http://stackoverflow.com/questions/8536269/what-is-the-difference-between-these-2-definitions-in-t4mvc/8543510">http://stackoverflow.com/questions/8536269/what-is-the-difference-between-these-2-definitions-in-t4mvc/8543510</a>)</li></ul>
<h3>2.6.65 (12-06-2011):</h3>
<ul><li>Add true constant strings for use in attributes (<a href="http://mvccontrib.codeplex.com/workitem/7177">http://mvccontrib.codeplex.com/workitem/7177</a>)</li></ul>
<h3>2.6.64 (10-21-2011):</h3>
<ul><li>Fix issue when action parameter name is escaped using @ syntax (e.g. int @event)</li></ul>
<h3>2.6.63 (10-13-2011):</h3>
<ul><li>Move hard coded T4MVC namespace into settings file</li></ul>
<h3>2.6.62 (08-13-2011):</h3>
<ul><li>Replace some unwanted tab characters with whitespace</li></ul>
<h3>2.6.61 (08-01-2011):</h3>
<ul><li>Ignore generic action methods (<a href="http://mvccontrib.codeplex.com/workitem/7156">http://mvccontrib.codeplex.com/workitem/7156</a>)</li></ul>
<h3>2.6.60 (07-28-2011):</h3>
<ul><li>Added support for portable areas. Enabled by adding area names to PortableAreas in T4MVC.tt.settings.t4</li>
<li>When generating links and views, if the folder name is the same as the parent, add a modifier to avoid class name conflicts (<a href="http://mvccontrib.codeplex.com/workitem/7153">http://mvccontrib.codeplex.com/workitem/7153</a>)</li></ul>
<h3>2.6.59 (07-12-2011):</h3>
<ul><li>Added commented out logic to show how to debug into the template (<a href="http://mvccontrib.codeplex.com/workitem/7144">http://mvccontrib.codeplex.com/workitem/7144</a>)</li>
<li>Ignore any class which name doesn&#39;t end with &quot;Controller&quot;</li></ul>
<h3>2.6.58 (06-24-2011):</h3>
<ul><li>Change the controller detection logic to be more reliable and ignore anything that doesn&#39;t extend Controller.</li></ul>
<h3>2.6.57 (06-21-2011):</h3>
<ul><li>Re-added Html.ActionLink/Url.Action overload without default params to avoid running into &quot;CS0854: An expression tree may not contain a call or invocation that uses optional arguments&quot;</li>
<li>Make ProcessControllerActionMethods look for ControllerBase instead of Controller to support controllers like MailerBase (from ActionMailer) which extend ControllerBase.</li></ul>
<h3>2.6.56 (06-05-2011):</h3>
<ul><li>Added optional Html.ActionLink parameters for protocol, hostname and fragment (<a href="http://stackoverflow.com/questions/6280347/how-can-i-add-a-hash-fragment-to-t4mvc-route-dictionary-actionresult/6302703">http://stackoverflow.com/questions/6280347/how-can-i-add-a-hash-fragment-to-t4mvc-route-dictionary-actionresult/6302703</a>)</li></ul>
<h3>2.6.55 (06-05-2011):</h3>
<ul><li>Added optional Url.Action parameters for protocol and hostname (<a href="http://stackoverflow.com/questions/6240568/t4mvc-doesnt-work-property-with-url-action">http://stackoverflow.com/questions/6240568/t4mvc-doesnt-work-property-with-url-action</a>)</li></ul>
<h3>2.6.54 (04-23-2011):</h3>
<ul><li>Added missing license to NuGet package and fixed some links. No actual template changes!</li></ul>
<h3>2.6.53 (04-18-2011):</h3>
<ul><li>Ignore actions marked as obsolete (<a href="http://mvccontrib.codeplex.com/workitem/7133">http://mvccontrib.codeplex.com/workitem/7133</a>)</li></ul>
<h3>2.6.52 (04-14-2011):</h3>
<ul><li>Moved the &#39;Dummy&#39; class under the GenerateMvcT4Extensions check</li>
<li>Always include the area token in the route values unless running on MVC 1.x</li></ul>
<h3>2.6.51 (04-12-2011):</h3>
<ul><li>Ignore async completion methods as they can&#39;t really be used in T4MVC, and can cause issues (<a href="http://stackoverflow.com/questions/5419173/t4mvc-asynccontroller">http://stackoverflow.com/questions/5419173/t4mvc-asynccontroller</a>)</li></ul>
<h3>2.6.50 (04-08-2011):</h3>
<ul><li>Added AddTimestampToStaticLink() method to settings file to allow more granular decision (per <a href="http://mvccontrib.codeplex.com/workitem/7129">this post</a>)</li>
<li>Added GenerateMvcT4Extensions settings flag to omit the generation of the System.Web.Mvc.T4Extensions class, which can be useful if it is already defined in a referenced library (see <a href="http://stackoverflow.com/questions/5563163/t4mvc-use-extension-methods-in-control-library/5574227">this post</a>)</li></ul>
<h3>2.6.44 (03-10-2011):</h3>
<ul><li>Added UseNonQualifiedViewNames flag which when set to true causes view names never to be fully qualified. Spark users may need that.</li></ul>
<h3>2.6.43 (02-24-2011):</h3>
<ul><li>Renamed T4MVC.settings.t4 to T4MVC.tt.settings.t4 so it feels more like a &#39;child&#39; file of T4MVC.tt</li></ul>
<h3>2.6.42 (02-01-2011):</h3>
<ul><li>Fix partial view support for MVC</li>
<li>Fix partial view support when name has periods (<a href="http://mvccontrib.codeplex.com/workitem/7113">http://mvccontrib.codeplex.com/workitem/7113</a>)</li></ul>
<h3>2.6.41 (01-17-2011):</h3>
<ul><li>Added AJAX BeginForm overloads</li></ul>
<h3>2.6.40 (01-05-2011):</h3>
<ul><li>Added BeginForm overload that just takes an ActionResult</li>
<li>Fix MapRouteArea to use UseNamespaceFallback when there are no namespaces</li></ul>
<h3>2.6.32 (12-15-2010):</h3>
<ul><li>Fix bug in controller name generation when IncludeAreasToken is true</li></ul>
<h3>2.6.31 (11-15-2010):</h3>
<ul><li>Improve error message when T4MVC generated files are out of date.</li>
<li>Changed some &#39;const bool&#39; settings to &#39;static bool&#39; to avoid unused code warnings.</li>
<li>Disabled regen optimization added in 2.6.14 since it doesn&#39;t catch view changes</li></ul>
<h3>2.6.30 (09-05-2010):</h3>
<ul><li>Changed ExplicitHtmlHelpersForPartials flag to be off by default (and fix a small issue when it&#39;s off)</li>
<li>Handled System.NotImplementedException if project type (e.g. Installer) does not implement CodeModel property</li>
<li>Fixed issue when action method params are all optional (<a href="http://stackoverflow.com/questions/3488610/t4mvc-and-named-parameters">http://stackoverflow.com/questions/3488610/t4mvc-and-named-parameters</a>)</li>
<li>Exclude Area related methods when using MVC 1.0, as that was breaking things</li>
<li>Added logic to special case DisplayTemplates/EditorTemplates folders, since they need short view names passed in</li></ul>
<h3>2.6.21 (07-20-2010):</h3>
<ul><li>Fix to the partial extension feature added in 2.6.20 to deal with conflicts</li></ul>
<h3>2.6.20 (07-19-2010):</h3>
<ul><li>Added extension methods to render partial views (see <a href="http://www.weirdlover.com/2010/05/12/t4mvc-extension-for-mvc-partials/">this post</a>)
<ul><li>e.g. Html.RenderPartial(&quot;Map&quot;, Model.Dinner); --&gt; Html.RenderMap(Model.Dinner);</li>
<li>Can be turned off in settings file via ExplicitHtmlHelpersForPartials flag.</li></ul></li></ul>
<h3>2.6.15 (05-16-2010):</h3>
<ul><li>Added missing MapRoute overloads to support namespaces</li>
<li>Added MapRoute extensions on AreaRegistrationContext to support areas. Had to name them MapRouteArea to avoid clash with existing MapRoute methods :(</li></ul>
<h3>2.6.14 (05-06-2010):</h3>
<ul><li>Added UseLowercaseRoutes flag to lower case the area, controller and action names in routes</li>
<li>Added support for Views folders that don&#39;t match a controller name.</li>
<li>Added optimization to not regenerate files when the controller has not changed since the last generation</li>
<li>Turn AlwaysKeepTemplateDirty to false by default. We now have an <a href="http://blogs.msdn.com/davidebb/archive/2010/03/18/an-even-better-way-to-run-t4mvc-a-vs-addin.aspx">addin</a> which provides a better solution to this</li></ul>
<h3>2.6.13 (03-08-2010):</h3>
<ul><li>Added AddTimestampToStaticLinks flag to T4MVC.settings.t4 to generate static links that change when the file changes.</li>
<li>Added support for [Bind(Prefix = &quot;newParamName&quot;)] attribute so it generates the correct route value</li>
<li>Added an AddRouteValues overload that takes NameValueCollection, e.g.
<ul><li>MVC.Home.About().AddRouteValues(Request.QueryString)</li></ul></li>
<li>Added MapRoute overload that supports contraints</li>
<li>Removed some logic to support VS2010 Beta 2. VS2010 RC or later should now be used.</li></ul>
<h3>2.6.12 (01-15-2010):</h3>
<ul><li>Fixed issue where some special project types (e.g. DB projects) were throwing while enumerating over the list</li>
<li>Changed to use GeneratedCode attribute instead of the less correct CompilerGenerated</li>
<li>Fixed CompilerGenerated/DebuggerNonUserCode attributes so they don&#39;t incorrectly affect the control classes</li>
<li>Change to avoid adding area to route if the app is not using areas</li></ul>
<h3>2.6.11 (01-10-2010):</h3>
<ul><li>Added ExcludedStaticFileExtensions setting to T4MVC.settings.t4 to list extensions for which static links should not be generated.</li>
<li>Support configurable name for IT4MVCActionResult, and it being defined externally (for sharing pourpose)</li>
<li>Added DebuggerNonUserCode attribute to generated classes</li>
<li>Improved error handling when trying to call T4MVC method with real ActionResult (previous threw InvalidCast)</li>
<li>Fix issue when overridden action methods were incorrectly marked as virtual</li></ul>
<h3>2.6.10 (01-04-2010):</h3>
<ul><li>Added support for adding arbitrary route parameters to T4MVC actions. e.g.
<ul><li>MVC.Home.About().AddRouteValue(&quot;fooKey&quot;, bar.Foo.Key)</li>
<li>MVC.Home.About().AddRouteValues(new {fooKey = bar.Foo.Key, barKey = bar.Key})</li></ul></li>
<li>Added shorter to refer to controller actions from with the controller itself. e.g.
<ul><li>return RedirectToAction(MVC.MyController.Actions.About()); BECOMES:</li>
<li>return RedirectToAction(Actions.About());</li></ul></li>
<li>What was previously called Actions was renamed to ActionNames (note, that&#39;s a BREAKING CHANGE if you used Actions before!)</li>
<li>Ignore controller methods that are marked with a NonAction attribute</li>
<li>Renamed IT4MVCActionResult.RouteValues to avoid conflict (this should not break anything, as it&#39;s only used internally)</li></ul>
<h3>2.6.03 (12-10-2009):</h3>
<ul><li>Generate full view paths to allow cross controller references
<ul><li>e.g. MVC.Dinners.Views.DinnerForm is now &quot;~/Views/Dinners/DinnerForm.ascx&quot; instead of just &quot;DinnerForm&quot;</li></ul></li>
<li>Fix compile error when a view name is a language keyword (e.g. string.ascx)</li></ul>
<h3>2.6.02 (12-04-2009)</h3>
<ul><li>Added way to get area name from both Area and Controller objects
<ul><li>e.g. MVC.MyArea.Name and MVC.MyArea.MyController.Area</li></ul></li>
<li>Added support for controllers in the default namespace (i.e. no namespace)</li>
<li>Always include the area in the route data, even when it&#39;s null/empty</li></ul>
<h3>2.6.01 (12-02-2009)</h3>
<ul><li>Fix compile error when a custom ActionResult type has a ctor that takes a value type</li></ul>
<h3>2.6.00 (11-28-2009)</h3>
<ul><li>Added support for MVC 2 Areas</li>
<li>Fixed issue where non-existing RenderAction method gets generated on VS2010 Beta 2</li>
<li>Added check to give proper error when attempting to run T4MVC outside VS (e.g. from TextTransform.exe)</li></ul>
<h3>2.5.02 (11-24-2009)</h3>
<ul><li>Change links in comment to point to new T4MVC home and forum</li>
<li>Fix scenario where a View folder as a name that&#39;s a C# keyword</li></ul>
<h3>2.5.01 (11-20-2009)</h3>
<ul><li>Added support for Html.RenderAction and Html.Action (see http://haacked.com/archive/2009/11/18/aspnetmvc2-render-action.aspx)</li>
<li>Fix null ref exception issue when custom ActionResult type doesn&#39;t have any explicit ctors</li></ul>
<h3>2.5.00 (11-16-2009)</h3>
<ul><li>Incorporated Damien Guard&#39;s multiple output manager to (optionally) split output from T4MVC into separate files to improve source control</li>
<li>Added support for minified javascript files in production</li>
<li>Fixed bug occurring when no action is of type ActionResult</li></ul>
<h3>2.4.04 (10-15-2009)</h3>
<ul><li>Added support for MVC 2 by detecting the version and generating slightly different code</li></ul>
<h3>2.4.03 (10-02-2009)</h3>
<ul><li>Added ProcessVirtualPath method to T4MVC.settings.t4 so user can write custom logic to modify client URL&#39;s</li>
<li>Greatly simplified GetProjectContainingT4File logic by using FindProjectItem().</li>
<li>Renamed generated classes to be CLS compliant</li>
<li>Moved most of the doc and versioning comments from T4MVC.tt into the readme.txt file, as it was getting a bit long.</li></ul>
<h3>2.4.02 (09-02-2009)</h3>
<ul><li>Added a setting in T4MVC.settings.t4 to set the namespace that Links get generated in</li>
<li>Added pragma to prevent compiler from complaining about missing Xml comments</li>
<li>Added &lt;auto-generated /&gt; comment to disable StyleCop in generated file</li>
<li>Fixed issue when using a custom ResultType in a custom namespace. Now fully qualifying result types.</li></ul>
<h3>2.4.01 (07-29-2009):</h3>
<ul><li>Put all the generated code in a T4MVC #region. This is useful to tell tools like ReSharper to ignore it.</li>
<li>Fixed issue where controller methods returning generic types cause template to blow up</li>
<li>Added a setting in T4MVC.settings.t4 to turn off the behavior that always keeps the template dirty</li></ul>
<h3>2.4.00 (07-28-2009):</h3>
<ul><li>Added support for configurable settings in a separate T4MVC.settings.t4 file</li>
<li>Added a parameter-less pseudo-action for every action that doesn&#39;t already have a parameter-less overload</li>
<li>Added support for having T4MVC.tt in a sub folder instead of always at the root of the project</li>
<li>Fixed issue when a base controller doesn&#39;t have a default ctor</li>
<li>Added T4Extensions into System.Web.Mvc namespace to fix ambiguous resolution issue </li>
<li>Misc cleanup</li></ul>
<h3>2.3.01 (07-10-2009):</h3>
<ul><li>Fixed issue with <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName&referringTitle=T4MVC_History">ActionName</a> attribute set to non literal string values (e.g. <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName%28SomeConst%20%2b%20%22Abc%22%29&referringTitle=T4MVC_History">ActionName&#40;SomeConst &#43; &#34;Abc&#34;&#41;</a>)</li>
<li>Fixed duplication issue when partial controller classes have a base type which contains action methods</li>
<li>Skip App_LocalResources when processing views</li>
<li>Cleaned up rendering logic</li></ul>
<h3>2.3.00 (07-07-2009):</h3>
<ul><li>Added support for sub view folders</li>
<li>Added support for <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName&referringTitle=T4MVC_History">ActionName</a> attribute</li>
<li>Improved handling when the controller comes from a different project</li>
<li>Don&#39;t try to process generic controller classes</li></ul>
<h3>2.2.03 (07-06-2009):</h3>
<ul><li>Added support for action methods defined on controller base classes</li>
<li>Improved error handling when not able to change actions to virtual and controllers to partial</li></ul>
<h3>2.2.02 (07-01-2009):</h3>
<ul><li>Fixed break caused by incorrect support for derived ActionResult types in 2.2.01</li>
<li>Fixed issue with duplicate view tokens getting generated when you have both foo.aspx and foo.ascx</li></ul>
<h3>2.2.01 (07-01-2009):</h3>
<ul><li>Added support for action methods that return a type derived from ActionResult (as opposed to exactly an ActionResult)</li>
<li>Fixed issue when controller is using partial classes</li>
<li>Fixed folder handling logic to deal with generated files</li>
<li>Fixed issue with folder names that are C# keyword</li>
<li>Throw NotSupportedException instead of NotImplementedException to avoid being viewed as a TODO</li></ul>
<h3>2.2.00 (06-30-2009):</h3>
<ul><li>Added strongly typed support to MapRoute</li>
<li>Changed constructor generation to avoid confusing IoC containers</li>
<li>Fixed issue with empty Content folder</li>
<li>Fixed issue with abstract controller base classes</li></ul>
<h3>2.1.00 (06-29-2009):</h3>
<ul><li>Added Html.BeginForm overloads that use the strongly typed pattern</li>
<li>Added Url() helpers on static resources to increase flexibility</li>
<li>Changed generated constants (view and action names, static files) to be readonly strings</li>
<li>Fixed null ref exception in Solution Folder logic</li></ul>
<h3>2.0.04 (06-28-2009):</h3>
<ul><li>Fixed issue with files and folders with names starting with a digit</li></ul>
<h3>2.0.03 (06-27-2009):</h3>
<ul><li>Rework code element enumeration logic to work around a VS2010 issue. The template should now work with VS2010 beta 1!</li>
<li>Reduced some redundancy in the generated code</li></ul>
<h3>2.0.02 (06-27-2009):</h3>
<ul><li>Added ActionLink overloads that take object instead of dictionary (from both Html and Ajax)</li></ul>
<h3>2.0.01 (06-26-2009):</h3>
<ul><li>Fixed issue with files and folders with invalid identifier characters (e.g. spaces, &#39;-&#39;, &#39;.&#39;)</li></ul>
<h3>2.0.00 (06-26-2009):</h3>
<ul><li>Added support for refactoring in Action methods</li>
<li>The T4 file automatically runs whenever you build, instead of being done manually</li>
<li>Support for strongly typed links to static resources</li>
<li>Fix: supports controllers that are in sub-folders of the Controllers folder and not directly in there</li>
<li>Fix: works better with nested solution folder </li>
<li>Random other small fixes</li></ul>
<h3>1.0.xx (06-17-2009):</h3>
<ul><li>the original based on <a href="http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx">this post</a></li></ul>
</div><div class="ClearBoth"></div>davidebboMon, 03 Mar 2014 01:39:25 GMTUpdated Wiki: T4MVC_History 20140303013925AUpdated Wiki: Documentationhttps://t4mvc.codeplex.com/documentation?version=15<div class="wikidoc"><h1>T4MVC Documentation page</h1>
<h2>1. Introduction</h2>
T4MVC is a T4 template for ASP.NET MVC apps that creates strongly typed helpers that eliminate the use of literal strings when referring the controllers, actions and views. It helps make your MVC code much more maintainable, and gives you intellisense where you normally would not have any. It was started by <a href="http://twitter.com/#!/davidebbo">David Ebbo</a> as a little blog post thing, and has since gained many new features based on great community feedback.<br /><br />T4MVC runs in both Visual Studio 2008 SP1 and Visual Studio 2010, and supports both ASP.NET MVC 1.0 and 2.0.<br /><br />To use it, simply install the T4MVC package using NuGet. You will get T4MVC.tt in your project, and will instantly see a number of files get created in Visual Studio under it.<br /><br />The code in those generated files enable a whole range of scenarios, all relating to replacing unwanted literal strings with a strongly typed alternative. The documentation below gives a complete list of those scenarios.<br />
<h3>1.1 It&#39;s still just standard MVC under the cover</h3>
One key concept to understand about T4MVC is that it is just a thin layer over MVC. e.g. while it provides strong typing, in the end it&#39;s just putting values in a dictionary, and using standard MVC to generate the routes.<br /><br />One thing I often suggest when people have questions is to first figure out how they would do things without T4MVC. If you have no idea how it would work, or think it may not be possible at all, then you are probably expecting too much of T4MVC! Generally, it will not do anything that MVC does not support.<br />
<h2>2. Scenarios</h2>
Instead of a formal documentation, we&#39;ll just demonstrate by example the various scenarios where T4MVC helps improve your code. The examples are shown in a before/after format to outline the change that is made.<br /><br />Note: a lot of the examples given below are based on the <a href="http://nerddinner.codeplex.com/">Nerd Dinner</a> sample MVC application. <br />
<h3>2.1 Using View Name constants</h3>
<br />Any time you would use a literal string to refer to a view, T4MVC gives you a strongly typed alternative. e.g. suppose you have this code in a view:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;% Html.RenderPartial(<span style="color:#A31515;">&quot;DinnerForm&quot;</span>); %&gt;
</pre></div>This ugly “DinnerForm” literal string needs to go! Instead, you can now write:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;% Html.RenderPartial(MVC.Dinners.Views.DinnerForm); %&gt;
</pre></div><br />When you need to use a view name inside a controller, things get even easier. e.g. you can replace:<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> View(<span style="color:#A31515;">&quot;InvalidOwner&quot;</span>);
</pre></div>by<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> View(Views.InvalidOwner);
</pre></div><br />Note how you can omit the MVC.Dinners prefix, since this is implied by the fact that the code lives in the Dinners controller.<br />
<h4>2.1.1 Non-Qualified View Name Constants</h4>
Non-qualified view names can be used via the ViewNames property underneath the Views property. Non-qualified views are usefull for allowing overloading and are needed by certain setups, e.g. Spark.<br /><br />Traditional &quot;Magic String&quot; Non-Qualified view:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> View(<span style="color:#A31515;">&quot;Index&quot;</span>);
</pre></div><br />T4MVC Non-Qualified view:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> View(Views.ViewNames.Index);
</pre></div>
<h3>2.2 Referring to controller actions</h3>
<br />Many MVC APIs follow a pattern where you need to pass three pieces of information in order to refer to a controller action:<br />
<ol><li>the controller name (often implied when dealing with the current controller)</li>
<li>the action method name</li>
<li>the parameters to be passed to the action method</li></ol>
<br />All of this is typically done by passing literal strings for #1 and #2, and an anonymous object for #3, e.g.<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, <span style="color:#A31515;">&quot;Delete&quot;</span>, <span style="color:#A31515;">&quot;Dinners&quot;</span>, <span style="color:Blue;">new</span> { id = Model.DinnerID }, <span style="color:Blue;">null</span>)%&gt;
</pre></div>Here, &quot;Delete&quot; and &quot;Dinners&quot; are clear literal strings that we&#39;d like to get rid of. But that&#39;s not all, as the paramter name &#39;id&#39; is as much of a problem as those other two. Even though it doesn’t look like a literal string, it very much is one in disguise. Don’t let those anonymous objects fool you!<br /><br />With T4MVC, you would instead write:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Dinners.Delete(Model.DinnerID))%&gt;
</pre></div>Basically, we got rid of the three unwanted literal strings (“Delete”, &quot;Dinners&quot; and “Id”), and replaced them by a very natural looking method call to the controller action. Of course, this is not really calling the controller action, which would be very wrong here. But it’s capturing the essence of method call, and turning it into the right route values.<br /><br />One other great benefit of this approach is that you get full intellisense while you type this line. In fact, you even get full refactoring support if you use a tool like resharper which supports aspx refactoring!<br />
<h4>Adding additional route parameters</h4>
In some situation, you may need to add extra values to the route that don’t exist in the action method. You can do it as follows:<br /><br /><div style="color:Black;background-color:White;"><pre>
Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Dinners.Delete(Model.DinnerID)
.AddRouteValue(<span style="color:#A31515;">&quot;foo&quot;</span>, 17))
</pre></div><br />You can add multiple values this way using a fluent approach, e.g.<br /><br /><div style="color:Black;background-color:White;"><pre>
Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Dinners.Delete(Model.DinnerID)
.AddRouteValue(<span style="color:#A31515;">&quot;foo&quot;</span>, 17)
.AddRouteValue(<span style="color:#A31515;">&quot;bar&quot;</span>, <span style="color:#A31515;">&quot;abc&quot;</span>))
</pre></div><br />As an alternative for adding multiple values, you can write:<br /><br /><div style="color:Black;background-color:White;"><pre>
Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Dinners.Delete(Model.DinnerID)
.AddRouteValues(<span style="color:Blue;">new</span> { foo = 17, bar = <span style="color:#A31515;">&quot;abc&quot;</span>}))
</pre></div><br />Note that in some cases, you may want to omit the action method parameters from the route, possibly because they are meant to come from form data and not from the URL. For those cases, you can always use the parameter-less override that T4MVC generates (that part is not new), e.g.<br /><br /><div style="color:Black;background-color:White;"><pre>
Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Dinners.Delete()
.AddRouteValues(<span style="color:Blue;">new</span> { foo = 17, bar = <span style="color:#A31515;">&quot;abc&quot;</span>}))
</pre></div><br />Now suppose you want to add all the current query string values to the route values produced by T4MVC. You can use the AddRouteValues() overload that takes a NameValueCollection. e.g.<br /><br /><div style="color:Black;background-color:White;"><pre>
RedirectToAction(MVC.Home.MyAction().AddRouteValues(Request.QueryString));
</pre></div><br />This adds to the existing set of AddRouteValue/AddRouteValues fluent APIs to make it easier to deal with all kind different situations.<br /><br />The nice thing about this fluent approach is that it doesn’t require adding overloads to all the T4MVC helpers (e.g. Html.ActionLink is this case) to take in the extra route values. Instead, it automatically applies to any method that uses the T4MVC pattern.<br /><br />The general pattern of making a pseudo-call to a controller action is used is many places in T4MVC:<br />
<h4>2.2.1 Html.ActionLink</h4>
Ok, we just covered that one above.<br />
<h4>2.2.2 Url.Action</h4>
<div style="color:Black;background-color:White;"><pre>
&lt;%= Url.Action(MVC.Dinners.Delete(Model.DinnerID))%&gt;
</pre></div>
<h4>2.2.2a Url.JavaScriptReplacableUrl</h4>
Two use cases for the above. <br /><br /><b>1st Use Case:</b><br />If you have an action you want to call from javascript like this:<br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Url.Action(MVC.Dinners.Display(Model.DinnerID))%&gt;
</pre></div>Odds are you want to get the Model.DinnerID from a javascript variable. So you end up with<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">var</span> myUrl=&lt;%= Url.Action(MVC.Dinners.Display())%&gt;
<span style="color:Green;">//myUrl will be /Dinners/Display</span>
<span style="color:Blue;">var</span> myFinalUrl=myUrl+<span style="color:#A31515;">&quot;/&quot;</span>+dinnerId; <span style="color:Green;">///Dinners/Display/12</span>
<span style="color:Green;">//or does it look like </span>
<span style="color:Blue;">var</span> myFinalUrl=myUrl+<span style="color:#A31515;">&quot;?dinnerID&quot;</span>+dinnerId; <span style="color:Green;">///Dinners/Display?dinnerId=12</span>
</pre></div>The issue is you are not sure how to compose the URL and if it changes, this will silently break.<br /><br /><b>2nd Use Case:</b><br />For the above action in your routing table you created a route like:<br />&quot;Dinners/Display/{dinnerId}&quot; - and you constrain dinnerId to be an integer larger than zero.<br /><br />Now, if you do the same scenario above:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">var</span> myUrl=&lt;%= Url.Action(MVC.Dinners.Display())%&gt;
</pre></div>The route will not be found - because there is not a route match (since dinnerId was not provided).<br /><br /><b>JavaScriptReplacableUrl solves both of these issues</b><br />No matter which use case, you define a specific route for the action (constrained parameters or not)<br />In the routing table you add:<br />&quot;Dinners/Display/{dinnerId}&quot; - (constrain dinnerId if you want)<br /><b>Note: You must define a specific route for JavaScriptReplacableUrl to work like this - it cannot work with &#39;default routes&#39;. If it cannot find a matching route it behaves like Url.Action().</b><br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">var</span> myUrl=&lt;%= Url.JavaScriptReplacableUrl(MVC.Dinners.Display())%&gt;
<span style="color:Green;">//myUrl will be Dinners/Display/{dinnerId} </span>
<span style="color:Blue;">var</span> myFinalUrl=myUrl.replace(<span style="color:#A31515;">&quot;{dinnerId}&quot;</span>, dinnerId); <span style="color:Green;">//this will have whatever route shape you defined in routing table!</span>
</pre></div><br />Note you can use the parameter name constants from T4MVC (and that will give you compile time checking for parameter name changes:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">var</span> myFinalUrl=myUrl.replace(<span style="color:#A31515;">&quot;{&quot;</span>+MVC.Dinners.DisplayParams.dinnerId+<span style="color:#A31515;">&quot;}&quot;</span>, dinnerId); <span style="color:Green;">//this will have whatever route shape you defined </span>
</pre></div><br />
<h4>2.2.3 Ajax.ActionLink</h4>
<div style="color:Black;background-color:White;"><pre>
&lt;%= Ajax.ActionLink( <span style="color:#A31515;">&quot;RSVP for this event&quot;</span>,
<span style="color:#A31515;">&quot;Register&quot;</span>, <span style="color:#A31515;">&quot;RSVP&quot;</span>,
<span style="color:Blue;">new</span> { id=Model.DinnerID },
<span style="color:Blue;">new</span> AjaxOptions { UpdateTargetId=<span style="color:#A31515;">&quot;rsvpmsg&quot;</span>, OnSuccess=<span style="color:#A31515;">&quot;AnimateRSVPMessage&quot;</span> }) %&gt;
</pre></div>becomes<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Ajax.ActionLink( <span style="color:#A31515;">&quot;RSVP for this event&quot;</span>,
MVC.RSVP.Register(Model.DinnerID),
<span style="color:Blue;">new</span> AjaxOptions { UpdateTargetId=<span style="color:#A31515;">&quot;rsvpmsg&quot;</span>, OnSuccess=<span style="color:#A31515;">&quot;AnimateRSVPMessage&quot;</span> }) %&gt;
</pre></div>
<h4>2.2.4 RedirectToAction (in controller code)</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> RedirectToAction(<span style="color:#A31515;">&quot;Details&quot;</span>, <span style="color:Blue;">new</span> { id = dinner.DinnerID });
</pre></div>becomes<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> RedirectToAction(MVC.Dinners.Details(dinner.DinnerID));
</pre></div>
<h4>2.2.5 routes.MapRoute (typically in global.asax)</h4>
<div style="color:Black;background-color:White;"><pre>
routes.MapRoute(
<span style="color:#A31515;">&quot;UpcomingDinners&quot;</span>,
<span style="color:#A31515;">&quot;Dinners/Page/{page}&quot;</span>,
<span style="color:Blue;">new</span> { controller = <span style="color:#A31515;">&quot;Dinners&quot;</span>, action = <span style="color:#A31515;">&quot;Index&quot;</span> }
);
</pre></div>becomes<br /><br /><div style="color:Black;background-color:White;"><pre>
routes.MapRoute(
<span style="color:#A31515;">&quot;UpcomingDinners&quot;</span>,
<span style="color:#A31515;">&quot;Dinners/Page/{page}&quot;</span>,
MVC.Dinners.Index(<span style="color:Blue;">null</span>)
);
</pre></div>
<h4>2.2.6 Html.BeginForm</h4>
Essentially, it’s the same support as ActionLink() but for the BeginForm() method. But note that because form posts typically pass most of the data via the form and not the URL, BeginForm() is trickier to use correctly than the other methods.<br /><br />Here is how you might use this:<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">using</span> (Html.BeginForm(MVC.Account.LogOn(), FormMethod.Post)) { ... }
</pre></div>Or if the action method takes parameters, you would pass them in the call. However, when you do this you need to make sure that you aren’t also trying to pass those same parameters via the form (e.g. using a text box).<br /><br />Generally, the rule of thumb is that this support works well when you’re dealing with forms where the Action method signature exactly matches the form URL.<br />
<h4>2.2.7 Html.RenderAction and Html.Action (only in MVC 2 or newer)</h4>
These are new to MVC 2. See Phil Haack&#39;s <a href="http://haacked.com/archive/2009/11/18/aspnetmvc2-render-action.aspx">post</a> about them for details.<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.Action(<span style="color:#A31515;">&quot;Menu&quot;</span>, <span style="color:Blue;">new</span> { options = <span style="color:Blue;">new</span> MenuOptions { Width=400, Height=500} })%&gt;
</pre></div>becomes<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.Action(MVC.Home.Menu(<span style="color:Blue;">new</span> MenuOptions { Width=400, Height=500})); %&gt;
</pre></div>Same deal for Html.RenderAction.<br />
<h3>2.3. Use constants to refer to area, controller, action and parameter names</h3>
<h4>2.3.1 Area name constants</h4>
<div style="color:Black;background-color:White;"><pre>
MVC.CoolArea.Name
</pre></div>
<h4>2.3.2 Controller name constants</h4>
<div style="color:Black;background-color:White;"><pre>
MVC.Home.Name
</pre></div>
<h4>2.3.3 Action name constants</h4>
<div style="color:Black;background-color:White;"><pre>
MVC.Home.ActionNames.Index
</pre></div>
<h4>2.3.4 Parameter name constants</h4>
Assuming a Home.MyAction action that takes a foo parameter, this evaluates to &quot;foo&quot;:<br /><br /><div style="color:Black;background-color:White;"><pre>
MVC.Home.MyActionParams.foo
</pre></div><br />
<h3>2.4. Strongly typed links to script files and static resources</h3>
<br />T4MVC generates static helpers for your content files and script files. So instead of writing:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;img src=<span style="color:#A31515;">&quot;/Content/nerd.jpg&quot;</span> /&gt;
</pre></div>You can write:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;img src=<span style="color:#A31515;">&quot;&lt;%= Links.Content.nerd_jpg %&gt;&quot;</span> /&gt;
</pre></div>Likewise, instead of<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;script src=<span style="color:#A31515;">&quot;/Scripts/Map.js&quot;</span> type=<span style="color:#A31515;">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;
</pre></div>You can write<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;script src=<span style="color:#A31515;">&quot;&lt;%= Links.Scripts.Map_js %&gt;&quot;</span> type=<span style="color:#A31515;">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;
</pre></div>The obvious benefit is that you’ll get a compile error if you ever move or rename your static resource, so you’ll catch it earlier.<br /><br />Another benefit is that you get a more versatile reference. When you write src=&quot;/Content/nerd.jpg&quot;, your app will only work when it’s deployed at the root of the site. But when you use the helper, it executes some server side logic that makes sure your reference is correct wherever your site is rooted. It does this by calling VirtualPathUtility.ToAbsolute(&quot;~/Content/nerd.jpg&quot;).<br /><br />One unfortunate thing is that for some reason, VS doesn’t support intellisense in the view for parameter values. As a workaround, you can type it outside of the tag to get intellisense and then copy it there.<br /><br /><b>Important note</b>: if you see strange links getting generated in your &lt;head&gt; tag, you just need to remove the runat=&quot;server&quot; from it.<br />
<h4> Support for MVC&#39;s script and style bundles</h4>
Starting from MVC4, one can define &quot;bundles&quot; of scripts and stylesheets which are automatically combined and minified. However, magic strings are used to define the resource URLs. To eliminate them, follow steps 1 to 3 below.<br /><br />1. Add the following to your own code, which will extend T4MVC&#39;s static partial &quot;Links.bundles.scripts&quot; and &quot;Links.bundles.styles&quot; classes:<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">namespace</span> Links {
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">partial</span> <span style="color:Blue;">class</span> bundles {
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">partial</span> <span style="color:Blue;">class</span> scripts {
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">readonly</span> <span style="color:Blue;">string</span> jquery = <span style="color:#A31515;">&quot;~/scripts/jquery&quot;</span>;
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">readonly</span> <span style="color:Blue;">string</span> jqueryui = <span style="color:#A31515;">&quot;~/scripts/jqueryui&quot;</span>;
}
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">partial</span> <span style="color:Blue;">class</span> styles {
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">readonly</span> <span style="color:Blue;">string</span> bootstrap = <span style="color:#A31515;">&quot;~/styles/boostrap&quot;</span>;
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">readonly</span> <span style="color:Blue;">string</span> theme = <span style="color:#A31515;">&quot;~/styles/theme&quot;</span>;
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">readonly</span> <span style="color:Blue;">string</span> common = <span style="color:#A31515;">&quot;~/styles/common&quot;</span>;
}
}
}
</pre></div><br />Notice how the magic strings are now defined in one place only, and are thus easy to maintain.<br /><br />2. Use the following to add your bundles to the runtime:<br /><br /><div style="color:Black;background-color:White;"><pre>
bundles.Add(<span style="color:Blue;">new</span> ScriptBundle(Links.bundles.scripts.jquery).Include(<span style="color:#A31515;">&quot;~/scripts/jquery-{version}.js&quot;</span>));
bundles.Add(<span style="color:Blue;">new</span> StyleBundle(Links.bundles.styles.bootstrap).Include(<span style="color:#A31515;">&quot;~/styles/bootstrap*.css&quot;</span>));
</pre></div><br />3. Use the following to use a bundle in a cshtml layout/view:<br /><br /><div style="color:Black;background-color:White;"><pre>
@Scripts.Render(Links.bundles.scripts.jquery)
@Styles.Render(Links.bundles.scripts.bootstrap)
</pre></div>
<h4>Support for Minified Javascript files</h4>
Minified javascript files are alternate version of the files that makes them as small as possible, but using various strategies like removing white space. e.g. in an MVC application’s Scripts folder, you’ll typically see both jquery-1.3.2.js and jquery-1.3.2.min.js. Usually, you want to use the minified version at deployment time (to make your site load faster), but the regular version at development time, so you can more easily debug into it.<br /><br />T4MVC makes it automatic to use one vs. the other depending on the context. e.g. suppose you have:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;script src=<span style="color:#A31515;">&quot;&lt;%= Links.Scripts.jquery_1_2_6_js %&gt;&quot;</span> type=<span style="color:#A31515;">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;
</pre></div>You don’t need to change anything to this line, but the token jquery_1_2_6_js will automatically point to either jquery-1.3.2.js or jquery-1.3.2.min.js depending on whether you’re running in production. How does it know whether you’re in production? It calls a method defined in T4MVC.tt.hooks.t4 which makes the decision. By default, it looks at whether debugging is enabled:<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">// Logic to determine if the app is running in production or dev environment</span>
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">bool</span> IsProduction() {
<span style="color:Blue;">return</span> (HttpContext.Current != <span style="color:Blue;">null</span> &amp;&amp; !HttpContext.Current.IsDebuggingEnabled);
}
</pre></div><br />But you can easily change this logic if you have a different way of determining ‘production’.<br />
<h3>2.5 Using T4MVC with &quot;Areas&quot;</h3>
<br />One of MVC 2&#39;s major new features is the support for breaking up a large application into &quot;Areas&quot;. This works by following a structure that looks like:<br />
<ul><li>Root folder
<ul><li>Areas
<ul><li>NerdDinner
<ul><li>Models</li>
<li>Views</li>
<li>Controllers</li></ul></li>
<li>Wiki
<ul><li>Models</li>
<li>Views</li>
<li>Controllers</li></ul></li></ul></li></ul></li></ul>
<br />T4MVC automatically works with your areas and makes them available in its object model. Here is an example:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.NerdDinner.Dinners.Delete(Model.DinnerID))%&gt;
</pre></div>Notice how we refered to the controller as MVC.<b>NerdDinner</b>.Dinners. Note that if you happen to have a top level controller with the same name as the area, this naming pattern would cause a conflict. In that case, T4MVC appends &#39;Area&#39; at the end of the area name to avoid the conflict. e.g. If you have both a Home area and a Home controller (top level), you would use MVC.Home<b>Area</b>.Hello to refer to the area.<br /><br />Optionally, if you set IncludeAreasToken to true in the settings.xml file, the naming scheme becomes:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Areas.NerdDinner.Dinners.Delete(Model.DinnerID))%&gt;
</pre></div>Note that in this case, the conflict situation discussed above cannot occur. But this comes with a price as you end up with one more segment all the time. I&#39;m debating whether to even keep this mode given that the default mode works quite well.<br />
<h3>2.6 Using T4MVC with AsyncController</h3>
<h4>2.6.1 Enable Asynchronous Action Support</h4>
To enable support for using asynchronous actions in T4MVC you first need to change the SupportAsyncActions setting to true. This is setting is false by default since Async action calls are handled a little differently than normal action calls.<br />
<h4>2.6.1 What it does</h4>
When enabled any AsyncController with an <b>Async action will have two new methods generated in it. The first method is the standard Parameterless Overload and the second one one with the same signature as the </b>Async method but with out the Async extension. In addition, this method returns the standard ActionResult regarless of the possible return types of the *Completed methods. <br /><br />For example the following action in your controller<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">public</span> <span style="color:Blue;">void</span> IndexAsync(<span style="color:Blue;">long</span> id)
{
...
}
<span style="color:Blue;">public</span> JsonResult IndexCompleted(Models.SomeModel model)
{
<span style="color:Blue;">return</span> <span style="color:Blue;">this</span>.JSON(model);
}
</pre></div><br />would cause the following code to be generated by T4MVC<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">public</span> <span style="color:Blue;">virtual</span> ActionResult Index()
{
...
}
<span style="color:Blue;">public</span> <span style="color:Blue;">virtual</span> ActionResult Index(<span style="color:Blue;">long</span> id)
{
...
}
</pre></div><br />With this additional code you can use MVC.Controller.Action() to generate links, regardless if the action<br />is Async or not, however, you cannot mix and match with the same method names, all must be either Async or not. <br />
<h2>3. Tweaking the behavior of T4MVC</h2>
When you download T4MVC, you not only get the main T4MVC.tt template, but you also get a file named T4MVC.tt.hooks.t4, which can conatin some extensibility hooks. In addition to that, T4MVC supports a T4MVC.tt.settings.xml. This file will be created with some defaults the first time T4MVC gets to run. This file contains various knobs that you can use to tweak the code generated by T4MVC. This section describes the various switches:<br />
<h3>3.1 Using Model &#39;unbinders&#39;</h3>
By default T4MVC basically performs a .ToString() operation when adding objects to URLs (route values). It works great for value types and strings, but usually fails at complex objects. Model unbinders let you inject your custom logic into the process of serializing model to URL parameters. Say, you have the following action:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">public</span> ActionResult Profile(User user) {}
<span style="color:Blue;">public</span> <span style="color:Blue;">class</span> User {
<span style="color:Blue;">public</span> <span style="color:Blue;">int</span> Id { <span style="color:Blue;">get</span>; <span style="color:Blue;">set</span>; }
<span style="color:Blue;">public</span> <span style="color:Blue;">string</span> Login { <span style="color:Blue;">get</span>; <span style="color:Blue;">set</span>; }
}
</pre></div>Here&#39;s the typical result of generating an URL for that action with T4MVC:<br /><div style="color:Black;background-color:White;"><pre>
@Url.Action(MVC.Home.Profile(<span style="color:Blue;">new</span> User {Id = 1})); <span style="color:Green;">// -&gt; /Home/Profile?user=Mvc.HomeController.User</span>
</pre></div>If you&#39;d like to get an URL like /Home/Profile?user=1 you could write a model unbinder, which should implement either IModelUnbinder or IModelUnbinder&lt;T&gt;:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">public</span> <span style="color:Blue;">class</span> UserUnbinder : IModelUnbinder&lt;User&gt;
{
<span style="color:Blue;">public</span> <span style="color:Blue;">void</span> UnbindModel(RouteValueDictionary routeValueDictionary, <span style="color:Blue;">string</span> routeName, User user)
{
<span style="color:Blue;">if</span> (user != <span style="color:Blue;">null</span>)
routeValueDictionary.Add(routeName, user.Id);
}
}
</pre></div>and then inject it to T4MVC in Application_Start: <br /><div style="color:Black;background-color:White;"><pre>
ModelUnbinderHelpers.ModelUnbinders.Add(<span style="color:Blue;">new</span> UserUnbinder());
</pre></div>After that you&#39;ll get exactly what described above:<br /><div style="color:Black;background-color:White;"><pre>
@Url.Action(MVC.Home.Profile(<span style="color:Blue;">new</span> User {Id = 1})); <span style="color:Green;">// -&gt; /Home/Profile?user=1</span>
</pre></div>If you want T4MVC to serialize all the properties of the certain type to url parameters, built-in PropertiesUnbinder could help you do this:<br /><div style="color:Black;background-color:White;"><pre>
ModelUnbinderHelpers.ModelUnbinders.Add(<span style="color:Blue;">typeof</span>(User), <span style="color:Blue;">new</span> PropertiesUnbinder());
</pre></div>In this case you&#39;ll get:<br /><div style="color:Black;background-color:White;"><pre>
@Url.Action(MVC.Home.Profile(<span style="color:Blue;">new</span> User {Id = 1, Login = <span style="color:#A31515;">&quot;test&quot;</span> })); <span style="color:Green;">// -&gt; /Home/Profile?user.Id=1&amp;user.Login=test</span>
</pre></div>which will gently suit the default MVC model binder. T4MVC searches for unbinders through the base types and interfaces that the object implements.<br />
<h3>3.2 XML Settings File</h3>
The T4MVC.tt.settings.t4 file have been replaced with a more &quot;upgrade friendly&quot; XML configuration file. This file is automatically generated/updated by the template when it is run, so the file will always reflect the current options and settings for the template. This new structure means that future upgrade to the template will not cause manual merging of your settings into a new settings, or for the template to break because a new setting was added. Your modified existing T4MVC.tt.settings.t4 will be left behind after upgrade and will not longer be used, however, the template cannot import your settings so you will have to edit the new XML file and copy them over. Once done you can safely delete the settings.t4 file.<br /><br />Two methods from the old settings file were moved into a new T4MVC.tt.hooks.t4 file, AddTimestampToStaticLink and RenderAdditionalCode. Neither of these tweaks could be properly represented in an XML file since they are adjustments to the template its self. Changes to this file should be rare and documented when done, so during upgrades you can generally ignore replacement errors if you have customized its contents.<br />
<h3>3.3 Miscellaneous tweaks</h3>
<h4>Set SplitIntoMultipleFiles to false to generate a single file with everything</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!-- If true,the template output will be split into multiple files. --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">SplitIntoMultipleFiles</span><span style="color:Blue;">&gt;</span>true<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">SplitIntoMultipleFiles</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Use HelpersPrefix to change the MVC prefix of the generated classes</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!-- The prefix used for things like MVC.Dinners.Name and MVC.Dinners.Delete(Model.DinnerID) --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">HelpersPrefix</span><span style="color:Blue;">&gt;</span>MVC<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">HelpersPrefix</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Use ControllersFolder and ViewsRootFolder to rename the Controllers and Views folders</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!-- The folder under the project that contains the controllers --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">ControllersFolder</span><span style="color:Blue;">&gt;</span>Controllers<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">ControllersFolder</span><span style="color:Blue;">&gt;</span>
<span style="color:Green;">&lt;!-- The folder under the project that contains the views --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">ViewsRootFolder</span><span style="color:Blue;">&gt;</span>Views<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">ViewsRootFolder</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Use LinksNamespace the generated links&#39; namespace</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!-- The namespace that the links are generated in (e.g. &quot;Links&quot;, as in Links.Content.nerd_jpg) --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">LinksNamespace</span><span style="color:Blue;">&gt;</span>Links<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">LinksNamespace</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Use StaticFilesFolders to tweak the list of folders from which links are generated</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!-- Folders containing static files for which links are generated (e.g. Links.Scripts.Map_js) --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">StaticFilesFolders</span><span style="color:Blue;">&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">FileFolder</span><span style="color:Blue;">&gt;</span>Scripts<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">FileFolder</span><span style="color:Blue;">&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">FileFolder</span><span style="color:Blue;">&gt;</span>Content<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">FileFolder</span><span style="color:Blue;">&gt;</span>
<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">StaticFilesFolders</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Use GenerateParamsAsConstantsForActionMethods to generate constants instead of static classes for parameter names. This lets you use them in attributes.</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!--The true the parameter name class will be generated as constants (allowing use in attributes). This is the suggested way to do this. However, if you used T4MVC Params before and referenced them outside the controller, your references will need to change from MVC.User.MyActionParams to MVC.UserController.MyActionParams. --&gt;</span> <span style="color:Blue;">&lt;</span><span style="color:#A31515;">GenerateParamsAsConstantsForActionMethods</span><span style="color:Blue;">&gt;</span>True<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">GenerateParamsAsConstantsForActionMethods</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Customize Action values</h4>
The generated T4MVC_<a href="https://t4mvc.codeplex.com/wikipage?title=ControllerClass&referringTitle=Documentation">ControllerClass</a> classes are now partial classes so you can extend and customize the values returned from MVC.Controller.Action() calls. In this class, for each overridden method a partial method call is available, if you implement that partial you have the ability to modify the the action values before they are returned.<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">partial</span> T4MVC_SomeController
{
<span style="color:Blue;">partial</span> <span style="color:Blue;">void</span> SomeAction(T4MVC_System_Web_Mvc_ActionResult callInfo)
{
callInfo.RouteValues[<span style="color:#A31515;">&quot;other&quot;</span>] = 1;
}
}
</pre></div><br />Also, the parameterless methods are not virtual so they can be overridden in the partial as well.<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">partial</span> T4MVC_SomeController
{
<span style="color:Blue;">public</span> <span style="color:Blue;">override</span> ActionResult SomeAction()
{
<span style="color:Blue;">var</span> callInfo = <span style="color:Blue;">base</span>.SomeAction();
callInfo.GetRouteValueDictionary()[<span style="color:#A31515;">&quot;other&quot;</span>] = 1;
<span style="color:Blue;">return</span> callInfo;
}
}
</pre></div>
<h2>4. Related resources</h2>
David Ebbo has written a series of <a href="http://blogs.msdn.com/davidebb/archive/tags/T4MVC/default.aspx">blog posts on T4MVC</a><br />Scott Hanselman also <a href="http://www.hanselman.com/blog/TheWeeklySourceCode43ASPNETMVCAndT4AndNerdDinner.aspx">blogged about it here</a></div><div class="ClearBoth"></div>davidebboSat, 30 Nov 2013 05:50:11 GMTUpdated Wiki: Documentation 20131130055011AUpdated Wiki: Documentationhttps://t4mvc.codeplex.com/documentation?version=14<div class="wikidoc"><h1>T4MVC Documentation page</h1>
<h2>1. Introduction</h2>
T4MVC is a T4 template for ASP.NET MVC apps that creates strongly typed helpers that eliminate the use of literal strings when referring the controllers, actions and views. It helps make your MVC code much more maintainable, and gives you intellisense where you normally would not have any. It was started by <a href="http://twitter.com/#!/davidebbo">David Ebbo</a> as a little blog post thing, and has since gained many new features based on great community feedback.<br /><br />T4MVC runs in both Visual Studio 2008 SP1 and Visual Studio 2010, and supports both ASP.NET MVC 1.0 and 2.0.<br /><br />To use it, simply install the T4MVC package using NuGet. You will get T4MVC.tt in your project, and will instantly see a number of files get created in Visual Studio under it.<br /><br />The code in those generated files enable a whole range of scenarios, all relating to replacing unwanted literal strings with a strongly typed alternative. The documentation below gives a complete list of those scenarios.<br />
<h2>2. Scenarios</h2>
Instead of a formal documentation, we&#39;ll just demonstrate by example the various scenarios where T4MVC helps improve your code. The examples are shown in a before/after format to outline the change that is made.<br /><br />Note: a lot of the examples given below are based on the <a href="http://nerddinner.codeplex.com/">Nerd Dinner</a> sample MVC application. <br />
<h3>2.1 Using View Name constants</h3>
<br />Any time you would use a literal string to refer to a view, T4MVC gives you a strongly typed alternative. e.g. suppose you have this code in a view:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;% Html.RenderPartial(<span style="color:#A31515;">&quot;DinnerForm&quot;</span>); %&gt;
</pre></div>This ugly “DinnerForm” literal string needs to go! Instead, you can now write:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;% Html.RenderPartial(MVC.Dinners.Views.DinnerForm); %&gt;
</pre></div><br />When you need to use a view name inside a controller, things get even easier. e.g. you can replace:<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> View(<span style="color:#A31515;">&quot;InvalidOwner&quot;</span>);
</pre></div>by<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> View(Views.InvalidOwner);
</pre></div><br />Note how you can omit the MVC.Dinners prefix, since this is implied by the fact that the code lives in the Dinners controller.<br />
<h4>2.1.1 Non-Qualified View Name Constants</h4>
Non-qualified view names can be used via the ViewNames property underneath the Views property. Non-qualified views are usefull for allowing overloading and are needed by certain setups, e.g. Spark.<br /><br />Traditional &quot;Magic String&quot; Non-Qualified view:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> View(<span style="color:#A31515;">&quot;Index&quot;</span>);
</pre></div><br />T4MVC Non-Qualified view:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> View(Views.ViewNames.Index);
</pre></div>
<h3>2.2 Referring to controller actions</h3>
<br />Many MVC APIs follow a pattern where you need to pass three pieces of information in order to refer to a controller action:<br />
<ol><li>the controller name (often implied when dealing with the current controller)</li>
<li>the action method name</li>
<li>the parameters to be passed to the action method</li></ol>
<br />All of this is typically done by passing literal strings for #1 and #2, and an anonymous object for #3, e.g.<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, <span style="color:#A31515;">&quot;Delete&quot;</span>, <span style="color:#A31515;">&quot;Dinners&quot;</span>, <span style="color:Blue;">new</span> { id = Model.DinnerID }, <span style="color:Blue;">null</span>)%&gt;
</pre></div>Here, &quot;Delete&quot; and &quot;Dinners&quot; are clear literal strings that we&#39;d like to get rid of. But that&#39;s not all, as the paramter name &#39;id&#39; is as much of a problem as those other two. Even though it doesn’t look like a literal string, it very much is one in disguise. Don’t let those anonymous objects fool you!<br /><br />With T4MVC, you would instead write:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Dinners.Delete(Model.DinnerID))%&gt;
</pre></div>Basically, we got rid of the three unwanted literal strings (“Delete”, &quot;Dinners&quot; and “Id”), and replaced them by a very natural looking method call to the controller action. Of course, this is not really calling the controller action, which would be very wrong here. But it’s capturing the essence of method call, and turning it into the right route values.<br /><br />One other great benefit of this approach is that you get full intellisense while you type this line. In fact, you even get full refactoring support if you use a tool like resharper which supports aspx refactoring!<br />
<h4>Adding additional route parameters</h4>
In some situation, you may need to add extra values to the route that don’t exist in the action method. You can do it as follows:<br /><br /><div style="color:Black;background-color:White;"><pre>
Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Dinners.Delete(Model.DinnerID)
.AddRouteValue(<span style="color:#A31515;">&quot;foo&quot;</span>, 17))
</pre></div><br />You can add multiple values this way using a fluent approach, e.g.<br /><br /><div style="color:Black;background-color:White;"><pre>
Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Dinners.Delete(Model.DinnerID)
.AddRouteValue(<span style="color:#A31515;">&quot;foo&quot;</span>, 17)
.AddRouteValue(<span style="color:#A31515;">&quot;bar&quot;</span>, <span style="color:#A31515;">&quot;abc&quot;</span>))
</pre></div><br />As an alternative for adding multiple values, you can write:<br /><br /><div style="color:Black;background-color:White;"><pre>
Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Dinners.Delete(Model.DinnerID)
.AddRouteValues(<span style="color:Blue;">new</span> { foo = 17, bar = <span style="color:#A31515;">&quot;abc&quot;</span>}))
</pre></div><br />Note that in some cases, you may want to omit the action method parameters from the route, possibly because they are meant to come from form data and not from the URL. For those cases, you can always use the parameter-less override that T4MVC generates (that part is not new), e.g.<br /><br /><div style="color:Black;background-color:White;"><pre>
Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Dinners.Delete()
.AddRouteValues(<span style="color:Blue;">new</span> { foo = 17, bar = <span style="color:#A31515;">&quot;abc&quot;</span>}))
</pre></div><br />Now suppose you want to add all the current query string values to the route values produced by T4MVC. You can use the AddRouteValues() overload that takes a NameValueCollection. e.g.<br /><br /><div style="color:Black;background-color:White;"><pre>
RedirectToAction(MVC.Home.MyAction().AddRouteValues(Request.QueryString));
</pre></div><br />This adds to the existing set of AddRouteValue/AddRouteValues fluent APIs to make it easier to deal with all kind different situations.<br /><br />The nice thing about this fluent approach is that it doesn’t require adding overloads to all the T4MVC helpers (e.g. Html.ActionLink is this case) to take in the extra route values. Instead, it automatically applies to any method that uses the T4MVC pattern.<br /><br />The general pattern of making a pseudo-call to a controller action is used is many places in T4MVC:<br />
<h4>2.2.1 Html.ActionLink</h4>
Ok, we just covered that one above.<br />
<h4>2.2.2 Url.Action</h4>
<div style="color:Black;background-color:White;"><pre>
&lt;%= Url.Action(MVC.Dinners.Delete(Model.DinnerID))%&gt;
</pre></div>
<h4>2.2.2a Url.JavaScriptReplacableUrl</h4>
Two use cases for the above. <br /><br /><b>1st Use Case:</b><br />If you have an action you want to call from javascript like this:<br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Url.Action(MVC.Dinners.Display(Model.DinnerID))%&gt;
</pre></div>Odds are you want to get the Model.DinnerID from a javascript variable. So you end up with<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">var</span> myUrl=&lt;%= Url.Action(MVC.Dinners.Display())%&gt;
<span style="color:Green;">//myUrl will be /Dinners/Display</span>
<span style="color:Blue;">var</span> myFinalUrl=myUrl+<span style="color:#A31515;">&quot;/&quot;</span>+dinnerId; <span style="color:Green;">///Dinners/Display/12</span>
<span style="color:Green;">//or does it look like </span>
<span style="color:Blue;">var</span> myFinalUrl=myUrl+<span style="color:#A31515;">&quot;?dinnerID&quot;</span>+dinnerId; <span style="color:Green;">///Dinners/Display?dinnerId=12</span>
</pre></div>The issue is you are not sure how to compose the URL and if it changes, this will silently break.<br /><br /><b>2nd Use Case:</b><br />For the above action in your routing table you created a route like:<br />&quot;Dinners/Display/{dinnerId}&quot; - and you constrain dinnerId to be an integer larger than zero.<br /><br />Now, if you do the same scenario above:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">var</span> myUrl=&lt;%= Url.Action(MVC.Dinners.Display())%&gt;
</pre></div>The route will not be found - because there is not a route match (since dinnerId was not provided).<br /><br /><b>JavaScriptReplacableUrl solves both of these issues</b><br />No matter which use case, you define a specific route for the action (constrained parameters or not)<br />In the routing table you add:<br />&quot;Dinners/Display/{dinnerId}&quot; - (constrain dinnerId if you want)<br /><b>Note: You must define a specific route for JavaScriptReplacableUrl to work like this - it cannot work with &#39;default routes&#39;. If it cannot find a matching route it behaves like Url.Action().</b><br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">var</span> myUrl=&lt;%= Url.JavaScriptReplacableUrl(MVC.Dinners.Display())%&gt;
<span style="color:Green;">//myUrl will be Dinners/Display/{dinnerId} </span>
<span style="color:Blue;">var</span> myFinalUrl=myUrl.replace(<span style="color:#A31515;">&quot;{dinnerId}&quot;</span>, dinnerId); <span style="color:Green;">//this will have whatever route shape you defined in routing table!</span>
</pre></div><br />Note you can use the parameter name constants from T4MVC (and that will give you compile time checking for parameter name changes:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">var</span> myFinalUrl=myUrl.replace(<span style="color:#A31515;">&quot;{&quot;</span>+MVC.Dinners.DisplayParams.dinnerId+<span style="color:#A31515;">&quot;}&quot;</span>, dinnerId); <span style="color:Green;">//this will have whatever route shape you defined </span>
</pre></div><br />
<h4>2.2.3 Ajax.ActionLink</h4>
<div style="color:Black;background-color:White;"><pre>
&lt;%= Ajax.ActionLink( <span style="color:#A31515;">&quot;RSVP for this event&quot;</span>,
<span style="color:#A31515;">&quot;Register&quot;</span>, <span style="color:#A31515;">&quot;RSVP&quot;</span>,
<span style="color:Blue;">new</span> { id=Model.DinnerID },
<span style="color:Blue;">new</span> AjaxOptions { UpdateTargetId=<span style="color:#A31515;">&quot;rsvpmsg&quot;</span>, OnSuccess=<span style="color:#A31515;">&quot;AnimateRSVPMessage&quot;</span> }) %&gt;
</pre></div>becomes<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Ajax.ActionLink( <span style="color:#A31515;">&quot;RSVP for this event&quot;</span>,
MVC.RSVP.Register(Model.DinnerID),
<span style="color:Blue;">new</span> AjaxOptions { UpdateTargetId=<span style="color:#A31515;">&quot;rsvpmsg&quot;</span>, OnSuccess=<span style="color:#A31515;">&quot;AnimateRSVPMessage&quot;</span> }) %&gt;
</pre></div>
<h4>2.2.4 RedirectToAction (in controller code)</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> RedirectToAction(<span style="color:#A31515;">&quot;Details&quot;</span>, <span style="color:Blue;">new</span> { id = dinner.DinnerID });
</pre></div>becomes<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">return</span> RedirectToAction(MVC.Dinners.Details(dinner.DinnerID));
</pre></div>
<h4>2.2.5 routes.MapRoute (typically in global.asax)</h4>
<div style="color:Black;background-color:White;"><pre>
routes.MapRoute(
<span style="color:#A31515;">&quot;UpcomingDinners&quot;</span>,
<span style="color:#A31515;">&quot;Dinners/Page/{page}&quot;</span>,
<span style="color:Blue;">new</span> { controller = <span style="color:#A31515;">&quot;Dinners&quot;</span>, action = <span style="color:#A31515;">&quot;Index&quot;</span> }
);
</pre></div>becomes<br /><br /><div style="color:Black;background-color:White;"><pre>
routes.MapRoute(
<span style="color:#A31515;">&quot;UpcomingDinners&quot;</span>,
<span style="color:#A31515;">&quot;Dinners/Page/{page}&quot;</span>,
MVC.Dinners.Index(<span style="color:Blue;">null</span>)
);
</pre></div>
<h4>2.2.6 Html.BeginForm</h4>
Essentially, it’s the same support as ActionLink() but for the BeginForm() method. But note that because form posts typically pass most of the data via the form and not the URL, BeginForm() is trickier to use correctly than the other methods.<br /><br />Here is how you might use this:<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">using</span> (Html.BeginForm(MVC.Account.LogOn(), FormMethod.Post)) { ... }
</pre></div>Or if the action method takes parameters, you would pass them in the call. However, when you do this you need to make sure that you aren’t also trying to pass those same parameters via the form (e.g. using a text box).<br /><br />Generally, the rule of thumb is that this support works well when you’re dealing with forms where the Action method signature exactly matches the form URL.<br />
<h4>2.2.7 Html.RenderAction and Html.Action (only in MVC 2 or newer)</h4>
These are new to MVC 2. See Phil Haack&#39;s <a href="http://haacked.com/archive/2009/11/18/aspnetmvc2-render-action.aspx">post</a> about them for details.<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.Action(<span style="color:#A31515;">&quot;Menu&quot;</span>, <span style="color:Blue;">new</span> { options = <span style="color:Blue;">new</span> MenuOptions { Width=400, Height=500} })%&gt;
</pre></div>becomes<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.Action(MVC.Home.Menu(<span style="color:Blue;">new</span> MenuOptions { Width=400, Height=500})); %&gt;
</pre></div>Same deal for Html.RenderAction.<br />
<h3>2.3. Use constants to refer to area, controller, action and parameter names</h3>
<h4>2.3.1 Area name constants</h4>
<div style="color:Black;background-color:White;"><pre>
MVC.CoolArea.Name
</pre></div>
<h4>2.3.2 Controller name constants</h4>
<div style="color:Black;background-color:White;"><pre>
MVC.Home.Name
</pre></div>
<h4>2.3.3 Action name constants</h4>
<div style="color:Black;background-color:White;"><pre>
MVC.Home.ActionNames.Index
</pre></div>
<h4>2.3.4 Parameter name constants</h4>
Assuming a Home.MyAction action that takes a foo parameter, this evaluates to &quot;foo&quot;:<br /><br /><div style="color:Black;background-color:White;"><pre>
MVC.Home.MyActionParams.foo
</pre></div><br />
<h3>2.4. Strongly typed links to script files and static resources</h3>
<br />T4MVC generates static helpers for your content files and script files. So instead of writing:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;img src=<span style="color:#A31515;">&quot;/Content/nerd.jpg&quot;</span> /&gt;
</pre></div>You can write:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;img src=<span style="color:#A31515;">&quot;&lt;%= Links.Content.nerd_jpg %&gt;&quot;</span> /&gt;
</pre></div>Likewise, instead of<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;script src=<span style="color:#A31515;">&quot;/Scripts/Map.js&quot;</span> type=<span style="color:#A31515;">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;
</pre></div>You can write<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;script src=<span style="color:#A31515;">&quot;&lt;%= Links.Scripts.Map_js %&gt;&quot;</span> type=<span style="color:#A31515;">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;
</pre></div>The obvious benefit is that you’ll get a compile error if you ever move or rename your static resource, so you’ll catch it earlier.<br /><br />Another benefit is that you get a more versatile reference. When you write src=&quot;/Content/nerd.jpg&quot;, your app will only work when it’s deployed at the root of the site. But when you use the helper, it executes some server side logic that makes sure your reference is correct wherever your site is rooted. It does this by calling VirtualPathUtility.ToAbsolute(&quot;~/Content/nerd.jpg&quot;).<br /><br />One unfortunate thing is that for some reason, VS doesn’t support intellisense in the view for parameter values. As a workaround, you can type it outside of the tag to get intellisense and then copy it there.<br /><br /><b>Important note</b>: if you see strange links getting generated in your &lt;head&gt; tag, you just need to remove the runat=&quot;server&quot; from it.<br />
<h4> Support for MVC&#39;s script and style bundles</h4>
Starting from MVC4, one can define &quot;bundles&quot; of scripts and stylesheets which are automatically combined and minified. However, magic strings are used to define the resource URLs. To eliminate them, follow steps 1 to 3 below.<br /><br />1. Add the following to your own code, which will extend T4MVC&#39;s static partial &quot;Links.bundles.scripts&quot; and &quot;Links.bundles.styles&quot; classes:<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">namespace</span> Links {
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">partial</span> <span style="color:Blue;">class</span> bundles {
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">partial</span> <span style="color:Blue;">class</span> scripts {
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">readonly</span> <span style="color:Blue;">string</span> jquery = <span style="color:#A31515;">&quot;~/scripts/jquery&quot;</span>;
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">readonly</span> <span style="color:Blue;">string</span> jqueryui = <span style="color:#A31515;">&quot;~/scripts/jqueryui&quot;</span>;
}
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">partial</span> <span style="color:Blue;">class</span> styles {
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">readonly</span> <span style="color:Blue;">string</span> bootstrap = <span style="color:#A31515;">&quot;~/styles/boostrap&quot;</span>;
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">readonly</span> <span style="color:Blue;">string</span> theme = <span style="color:#A31515;">&quot;~/styles/theme&quot;</span>;
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">readonly</span> <span style="color:Blue;">string</span> common = <span style="color:#A31515;">&quot;~/styles/common&quot;</span>;
}
}
}
</pre></div><br />Notice how the magic strings are now defined in one place only, and are thus easy to maintain.<br /><br />2. Use the following to add your bundles to the runtime:<br /><br /><div style="color:Black;background-color:White;"><pre>
bundles.Add(<span style="color:Blue;">new</span> ScriptBundle(Links.bundles.scripts.jquery).Include(<span style="color:#A31515;">&quot;~/scripts/jquery-{version}.js&quot;</span>));
bundles.Add(<span style="color:Blue;">new</span> StyleBundle(Links.bundles.styles.bootstrap).Include(<span style="color:#A31515;">&quot;~/styles/bootstrap*.css&quot;</span>));
</pre></div><br />3. Use the following to use a bundle in a cshtml layout/view:<br /><br /><div style="color:Black;background-color:White;"><pre>
@Scripts.Render(Links.bundles.scripts.jquery)
@Styles.Render(Links.bundles.scripts.bootstrap)
</pre></div>
<h4>Support for Minified Javascript files</h4>
Minified javascript files are alternate version of the files that makes them as small as possible, but using various strategies like removing white space. e.g. in an MVC application’s Scripts folder, you’ll typically see both jquery-1.3.2.js and jquery-1.3.2.min.js. Usually, you want to use the minified version at deployment time (to make your site load faster), but the regular version at development time, so you can more easily debug into it.<br /><br />T4MVC makes it automatic to use one vs. the other depending on the context. e.g. suppose you have:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;script src=<span style="color:#A31515;">&quot;&lt;%= Links.Scripts.jquery_1_2_6_js %&gt;&quot;</span> type=<span style="color:#A31515;">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;
</pre></div>You don’t need to change anything to this line, but the token jquery_1_2_6_js will automatically point to either jquery-1.3.2.js or jquery-1.3.2.min.js depending on whether you’re running in production. How does it know whether you’re in production? It calls a method defined in T4MVC.tt.hooks.t4 which makes the decision. By default, it looks at whether debugging is enabled:<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">// Logic to determine if the app is running in production or dev environment</span>
<span style="color:Blue;">public</span> <span style="color:Blue;">static</span> <span style="color:Blue;">bool</span> IsProduction() {
<span style="color:Blue;">return</span> (HttpContext.Current != <span style="color:Blue;">null</span> &amp;&amp; !HttpContext.Current.IsDebuggingEnabled);
}
</pre></div><br />But you can easily change this logic if you have a different way of determining ‘production’.<br />
<h3>2.5 Using T4MVC with &quot;Areas&quot;</h3>
<br />One of MVC 2&#39;s major new features is the support for breaking up a large application into &quot;Areas&quot;. This works by following a structure that looks like:<br />
<ul><li>Root folder
<ul><li>Areas
<ul><li>NerdDinner
<ul><li>Models</li>
<li>Views</li>
<li>Controllers</li></ul></li>
<li>Wiki
<ul><li>Models</li>
<li>Views</li>
<li>Controllers</li></ul></li></ul></li></ul></li></ul>
<br />T4MVC automatically works with your areas and makes them available in its object model. Here is an example:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.NerdDinner.Dinners.Delete(Model.DinnerID))%&gt;
</pre></div>Notice how we refered to the controller as MVC.<b>NerdDinner</b>.Dinners. Note that if you happen to have a top level controller with the same name as the area, this naming pattern would cause a conflict. In that case, T4MVC appends &#39;Area&#39; at the end of the area name to avoid the conflict. e.g. If you have both a Home area and a Home controller (top level), you would use MVC.Home<b>Area</b>.Hello to refer to the area.<br /><br />Optionally, if you set IncludeAreasToken to true in the settings.xml file, the naming scheme becomes:<br /><br /><div style="color:Black;background-color:White;"><pre>
&lt;%= Html.ActionLink(<span style="color:#A31515;">&quot;Delete Dinner&quot;</span>, MVC.Areas.NerdDinner.Dinners.Delete(Model.DinnerID))%&gt;
</pre></div>Note that in this case, the conflict situation discussed above cannot occur. But this comes with a price as you end up with one more segment all the time. I&#39;m debating whether to even keep this mode given that the default mode works quite well.<br />
<h3>2.6 Using T4MVC with AsyncController</h3>
<h4>2.6.1 Enable Asynchronous Action Support</h4>
To enable support for using asynchronous actions in T4MVC you first need to change the SupportAsyncActions setting to true. This is setting is false by default since Async action calls are handled a little differently than normal action calls.<br />
<h4>2.6.1 What it does</h4>
When enabled any AsyncController with an <b>Async action will have two new methods generated in it. The first method is the standard Parameterless Overload and the second one one with the same signature as the </b>Async method but with out the Async extension. In addition, this method returns the standard ActionResult regarless of the possible return types of the *Completed methods. <br /><br />For example the following action in your controller<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">public</span> <span style="color:Blue;">void</span> IndexAsync(<span style="color:Blue;">long</span> id)
{
...
}
<span style="color:Blue;">public</span> JsonResult IndexCompleted(Models.SomeModel model)
{
<span style="color:Blue;">return</span> <span style="color:Blue;">this</span>.JSON(model);
}
</pre></div><br />would cause the following code to be generated by T4MVC<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">public</span> <span style="color:Blue;">virtual</span> ActionResult Index()
{
...
}
<span style="color:Blue;">public</span> <span style="color:Blue;">virtual</span> ActionResult Index(<span style="color:Blue;">long</span> id)
{
...
}
</pre></div><br />With this additional code you can use MVC.Controller.Action() to generate links, regardless if the action<br />is Async or not, however, you cannot mix and match with the same method names, all must be either Async or not. <br />
<h2>3. Tweaking the behavior of T4MVC</h2>
When you download T4MVC, you not only get the main T4MVC.tt template, but you also get a file named T4MVC.tt.hooks.t4, which can conatin some extensibility hooks. In addition to that, T4MVC supports a T4MVC.tt.settings.xml. This file will be created with some defaults the first time T4MVC gets to run. This file contains various knobs that you can use to tweak the code generated by T4MVC. This section describes the various switches:<br />
<h3>3.1 Using Model &#39;unbinders&#39;</h3>
By default T4MVC basically performs a .ToString() operation when adding objects to URLs (route values). It works great for value types and strings, but usually fails at complex objects. Model unbinders let you inject your custom logic into the process of serializing model to URL parameters. Say, you have the following action:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">public</span> ActionResult Profile(User user) {}
<span style="color:Blue;">public</span> <span style="color:Blue;">class</span> User {
<span style="color:Blue;">public</span> <span style="color:Blue;">int</span> Id { <span style="color:Blue;">get</span>; <span style="color:Blue;">set</span>; }
<span style="color:Blue;">public</span> <span style="color:Blue;">string</span> Login { <span style="color:Blue;">get</span>; <span style="color:Blue;">set</span>; }
}
</pre></div>Here&#39;s the typical result of generating an URL for that action with T4MVC:<br /><div style="color:Black;background-color:White;"><pre>
@Url.Action(MVC.Home.Profile(<span style="color:Blue;">new</span> User {Id = 1})); <span style="color:Green;">// -&gt; /Home/Profile?user=Mvc.HomeController.User</span>
</pre></div>If you&#39;d like to get an URL like /Home/Profile?user=1 you could write a model unbinder, which should implement either IModelUnbinder or IModelUnbinder&lt;T&gt;:<br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">public</span> <span style="color:Blue;">class</span> UserUnbinder : IModelUnbinder&lt;User&gt;
{
<span style="color:Blue;">public</span> <span style="color:Blue;">void</span> UnbindModel(RouteValueDictionary routeValueDictionary, <span style="color:Blue;">string</span> routeName, User user)
{
<span style="color:Blue;">if</span> (user != <span style="color:Blue;">null</span>)
routeValueDictionary.Add(routeName, user.Id);
}
}
</pre></div>and then inject it to T4MVC in Application_Start: <br /><div style="color:Black;background-color:White;"><pre>
ModelUnbinderHelpers.ModelUnbinders.Add(<span style="color:Blue;">new</span> UserUnbinder());
</pre></div>After that you&#39;ll get exactly what described above:<br /><div style="color:Black;background-color:White;"><pre>
@Url.Action(MVC.Home.Profile(<span style="color:Blue;">new</span> User {Id = 1})); <span style="color:Green;">// -&gt; /Home/Profile?user=1</span>
</pre></div>If you want T4MVC to serialize all the properties of the certain type to url parameters, built-in PropertiesUnbinder could help you do this:<br /><div style="color:Black;background-color:White;"><pre>
ModelUnbinderHelpers.ModelUnbinders.Add(<span style="color:Blue;">typeof</span>(User), <span style="color:Blue;">new</span> PropertiesUnbinder());
</pre></div>In this case you&#39;ll get:<br /><div style="color:Black;background-color:White;"><pre>
@Url.Action(MVC.Home.Profile(<span style="color:Blue;">new</span> User {Id = 1, Login = <span style="color:#A31515;">&quot;test&quot;</span> })); <span style="color:Green;">// -&gt; /Home/Profile?user.Id=1&amp;user.Login=test</span>
</pre></div>which will gently suit the default MVC model binder. T4MVC searches for unbinders through the base types and interfaces that the object implements.<br />
<h3>3.2 XML Settings File</h3>
The T4MVC.tt.settings.t4 file have been replaced with a more &quot;upgrade friendly&quot; XML configuration file. This file is automatically generated/updated by the template when it is run, so the file will always reflect the current options and settings for the template. This new structure means that future upgrade to the template will not cause manual merging of your settings into a new settings, or for the template to break because a new setting was added. Your modified existing T4MVC.tt.settings.t4 will be left behind after upgrade and will not longer be used, however, the template cannot import your settings so you will have to edit the new XML file and copy them over. Once done you can safely delete the settings.t4 file.<br /><br />Two methods from the old settings file were moved into a new T4MVC.tt.hooks.t4 file, AddTimestampToStaticLink and RenderAdditionalCode. Neither of these tweaks could be properly represented in an XML file since they are adjustments to the template its self. Changes to this file should be rare and documented when done, so during upgrades you can generally ignore replacement errors if you have customized its contents.<br />
<h3>3.3 Miscellaneous tweaks</h3>
<h4>Set SplitIntoMultipleFiles to false to generate a single file with everything</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!-- If true,the template output will be split into multiple files. --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">SplitIntoMultipleFiles</span><span style="color:Blue;">&gt;</span>true<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">SplitIntoMultipleFiles</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Use HelpersPrefix to change the MVC prefix of the generated classes</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!-- The prefix used for things like MVC.Dinners.Name and MVC.Dinners.Delete(Model.DinnerID) --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">HelpersPrefix</span><span style="color:Blue;">&gt;</span>MVC<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">HelpersPrefix</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Use ControllersFolder and ViewsRootFolder to rename the Controllers and Views folders</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!-- The folder under the project that contains the controllers --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">ControllersFolder</span><span style="color:Blue;">&gt;</span>Controllers<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">ControllersFolder</span><span style="color:Blue;">&gt;</span>
<span style="color:Green;">&lt;!-- The folder under the project that contains the views --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">ViewsRootFolder</span><span style="color:Blue;">&gt;</span>Views<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">ViewsRootFolder</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Use LinksNamespace the generated links&#39; namespace</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!-- The namespace that the links are generated in (e.g. &quot;Links&quot;, as in Links.Content.nerd_jpg) --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">LinksNamespace</span><span style="color:Blue;">&gt;</span>Links<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">LinksNamespace</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Use StaticFilesFolders to tweak the list of folders from which links are generated</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!-- Folders containing static files for which links are generated (e.g. Links.Scripts.Map_js) --&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">StaticFilesFolders</span><span style="color:Blue;">&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">FileFolder</span><span style="color:Blue;">&gt;</span>Scripts<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">FileFolder</span><span style="color:Blue;">&gt;</span>
<span style="color:Blue;">&lt;</span><span style="color:#A31515;">FileFolder</span><span style="color:Blue;">&gt;</span>Content<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">FileFolder</span><span style="color:Blue;">&gt;</span>
<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">StaticFilesFolders</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Use GenerateParamsAsConstantsForActionMethods to generate constants instead of static classes for parameter names. This lets you use them in attributes.</h4>
<div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">&lt;!--The true the parameter name class will be generated as constants (allowing use in attributes). This is the suggested way to do this. However, if you used T4MVC Params before and referenced them outside the controller, your references will need to change from MVC.User.MyActionParams to MVC.UserController.MyActionParams. --&gt;</span> <span style="color:Blue;">&lt;</span><span style="color:#A31515;">GenerateParamsAsConstantsForActionMethods</span><span style="color:Blue;">&gt;</span>True<span style="color:Blue;">&lt;/</span><span style="color:#A31515;">GenerateParamsAsConstantsForActionMethods</span><span style="color:Blue;">&gt;</span>
</pre></div>
<h4>Customize Action values</h4>
The generated T4MVC_<a href="https://t4mvc.codeplex.com/wikipage?title=ControllerClass&referringTitle=Documentation">ControllerClass</a> classes are now partial classes so you can extend and customize the values returned from MVC.Controller.Action() calls. In this class, for each overridden method a partial method call is available, if you implement that partial you have the ability to modify the the action values before they are returned.<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">partial</span> T4MVC_SomeController
{
<span style="color:Blue;">partial</span> <span style="color:Blue;">void</span> SomeAction(T4MVC_System_Web_Mvc_ActionResult callInfo)
{
callInfo.RouteValues[<span style="color:#A31515;">&quot;other&quot;</span>] = 1;
}
}
</pre></div><br />Also, the parameterless methods are not virtual so they can be overridden in the partial as well.<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">partial</span> T4MVC_SomeController
{
<span style="color:Blue;">public</span> <span style="color:Blue;">override</span> ActionResult SomeAction()
{
<span style="color:Blue;">var</span> callInfo = <span style="color:Blue;">base</span>.SomeAction();
callInfo.GetRouteValueDictionary()[<span style="color:#A31515;">&quot;other&quot;</span>] = 1;
<span style="color:Blue;">return</span> callInfo;
}
}
</pre></div>
<h2>4. Related resources</h2>
David Ebbo has written a series of <a href="http://blogs.msdn.com/davidebb/archive/tags/T4MVC/default.aspx">blog posts on T4MVC</a><br />Scott Hanselman also <a href="http://www.hanselman.com/blog/TheWeeklySourceCode43ASPNETMVCAndT4AndNerdDinner.aspx">blogged about it here</a></div><div class="ClearBoth"></div>davidebboSat, 26 Oct 2013 15:05:33 GMTUpdated Wiki: Documentation 20131026030533PUpdated Wiki: T4MVC_Historyhttps://t4mvc.codeplex.com/wikipage?title=T4MVC_History&version=33<div class="wikidoc"><h1>T4MVC change history</h1>
<h3>3.7.2 (8-07-2013)</h3>
<ul><li>Fix abstract view result method generation. <a href="https://t4mvc.codeplex.com/workitem/23">https://t4mvc.codeplex.com/workitem/23</a></li></ul>
<h3>3.7.1 (7-05-2013)</h3>
<ul><li>Fixed bug where AddRouteValue() throws ArgumentException if route value has already been added. <a href="https://t4mvc.codeplex.com/workitem/25">https://t4mvc.codeplex.com/workitem/25</a></li></ul>
<h3>3.7.0 (6-16-2013)</h3>
<ul><li>New AddAllViewsFoldersToStaticFilesFolders flag to include view folder files as static files (off by default) <a href="https://t4mvc.codeplex.com/discussions/445358">https://t4mvc.codeplex.com/discussions/445358</a></li>
<li>New ExcludedViewExtensions setting to not treat certain file extensions as views</li></ul>
<h3>3.6.5 (5-19-2013)</h3>
<ul><li>Use Controller constructor with least number of params. <a href="https://t4mvc.codeplex.com/workitem/22">https://t4mvc.codeplex.com/workitem/22</a></li></ul>
<h3>3.6.4 (5-08-2013)</h3>
<ul><li>Added support for checking files out with Perforce P4VS. <a href="https://t4mvc.codeplex.com/discussions/442992">https://t4mvc.codeplex.com/discussions/442992</a></li></ul>
<h3>3.6.3 (5-08-2013)</h3>
<ul><li>Fix assembly signing</li></ul>
<h3>3.6.2 (5-07-2013)</h3>
<ul><li>Avoid identifier conflict when content file names are similar. <a href="https://t4mvc.codeplex.com/discussions/441214">https://t4mvc.codeplex.com/discussions/441214</a></li></ul>
<h3>3.6.1 (5-03-2013)</h3>
<ul><li>Make actionresult classes partial. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/duncans/T4MVC/contribution/4632">https://t4mvc.codeplex.com/SourceControl/network/forks/duncans/T4MVC/contribution/4632</a></li></ul>
<h3>3.6.0 (4-26-2013)</h3>
<ul><li>Add support for task based actions. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/kev_bite/T4mvcTaskBasedActions/contribution/4564">https://t4mvc.codeplex.com/SourceControl/network/forks/kev_bite/T4mvcTaskBasedActions/contribution/4564</a></li></ul>
<h3>3.5.4 (4-22-2013)</h3>
<ul><li>Make action results internal to avoid cross project conflicts</li></ul>
<h3>3.5.3 (4-19-2013):</h3>
<ul><li>Add support for portable areas without a standard area folder</li></ul>
<h3>3.5.2 (3-07-2013):</h3>
<ul><li>Add support for inherited controller attributes. <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/4194">http://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/4194</a></li></ul>
<h3>3.5.1 (2-25-2013):</h3>
<ul><li>If static files include a timestamp, previously for minified CSS- and JavaScript-files the timestamp was generated by taking the last change time of the unminified file. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4122">https://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4122</a></li></ul>
<h3>3.5.0 (2-08-2013):</h3>
<ul><li>Sign T4MVCExtensions.dll <a href="http://t4mvc.codeplex.com/discussions/432534">http://t4mvc.codeplex.com/discussions/432534</a></li>
<li>Call T4Extension.TimestampString through delegate for unit testing <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4040">http://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4040</a></li></ul>
<h3>3.4.1 (1-31-2013):</h3>
<ul><li>Make T4MVCHelpers internal to avoid cross project conflicts <a href="http://t4mvc.codeplex.com/workitem/17">http://t4mvc.codeplex.com/workitem/17</a></li></ul>
<h3>3.4.0 (1-23-2013):</h3>
<ul><li>Add optional support for async methods <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/3958">https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/3958</a></li>
<li>Generate partial methods to allow custom &quot;overloading&quot; of the return values.</li></ul>
<h3>3.3.0 (1-16-2013):</h3>
<ul><li> Add support for support for model unbinder providers <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/Augi/T4MVCUnbinderProvider/contribution/3879">https://t4mvc.codeplex.com/SourceControl/network/forks/Augi/T4MVCUnbinderProvider/contribution/3879</a></li>
<li> Fix handling of &quot;completed&quot; methods <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/phw/t4mvc/contribution/3922">https://t4mvc.codeplex.com/SourceControl/network/forks/phw/t4mvc/contribution/3922</a></li></ul>
<h3>3.2.1 (12-27-2012):</h3>
<ul><li> Fix issue with VB projects causing exceptions <a href="http://t4mvc.codeplex.com/workitem/7">http://t4mvc.codeplex.com/workitem/7</a></li></ul>
<h3>3.2.0 (12-11-2012):</h3>
<ul><li> Add option to make parameter names constants <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/WayneBrantley/ParameterNamesToConst/contribution/3762">https://t4mvc.codeplex.com/SourceControl/network/forks/WayneBrantley/ParameterNamesToConst/contribution/3762</a></li></ul>
<h3>3.1.0 (12-09-2012):</h3>
<ul><li>Added JavaScriptReplacableUrl helper <a href="http://t4mvc.codeplex.com/discussions/405911">http://t4mvc.codeplex.com/discussions/405911</a></li></ul>
<h3>3.0.3 (11-30-2012):</h3>
<ul><li>Fix to deal with multiple attributes <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/ArtiomChi/t4mvc/contribution/3723">http://t4mvc.codeplex.com/SourceControl/network/forks/ArtiomChi/t4mvc/contribution/3723</a></li></ul>
<h3>3.0.2 (11-17-2012):</h3>
<ul><li>Add support for generic result types <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/ryanrust/T4MVC/contribution/3653">http://t4mvc.codeplex.com/SourceControl/network/forks/ryanrust/T4MVC/contribution/3653</a></li></ul>
<h3>3.0.1 (11-16-2012):</h3>
<ul><li>Fix T4MVC.tt.settings.xml so it only gets generated when needed <a href="https://t4mvc.codeplex.com/discussions/403390">https://t4mvc.codeplex.com/discussions/403390</a></li></ul>
<h3>3.0.0 (11-14-2012):</h3>
<ul><li>Move all the non-dynamic code to a separate T4MVCExtensions.dll assembly</li>
<li>Change generated code brace style to Allman</li>
<li>Added many new RouteLink/BeginRouteForm/RouteUrl helpers</li></ul>
<h3>2.13.0 (10-24-2012):</h3>
<ul><li>Move settings to T4MVC.tt.settings.xml XML file instead of tt file. See doc for details.</li>
<li>Make simple view names available alongside full names, e.g. MVC.Home.Views.SomeView vs MVC.Home.Views.ViewNames.SomeView</li></ul>
<h3>2.12.0 (10-16-2012):</h3>
<ul><li>Add support for static files in nested folders <a href="http://t4mvc.codeplex.com/workitem/6">http://t4mvc.codeplex.com/workitem/6</a></li>
<li>Add MVC 4 bundle starter classes <a href="https://t4mvc.codeplex.com/discussions/399205">https://t4mvc.codeplex.com/discussions/399205</a></li></ul>
<h3>2.11.2 (10-11-2012):</h3>
<ul><li>Removed optional params in ActionLink to support expression trees <a href="http://t4mvc.codeplex.com/workitem/4">http://t4mvc.codeplex.com/workitem/4</a></li>
<li>Change brace style of generated code to Allman</li></ul>
<h3>2.11.1 (10-10-2012):</h3>
<ul><li>Ignore methods that return generic types <a href="http://mvccontrib.codeplex.com/workitem/7178">http://mvccontrib.codeplex.com/workitem/7178</a></li></ul>
<h3>2.11.0 (10-09-2012):</h3>
<ul><li>Corrects the ActionParameters class for overloaded actions to list all parameters and not just the parameters from the first action found.</li></ul>
<h3>2.10.4 (10-05-2012):</h3>
<ul><li>Added attributes so it builds clean under Code Analysis <a href="http://t4mvc.codeplex.com/workitem/10">http://t4mvc.codeplex.com/workitem/10</a></li></ul>
<h3>2.10.3 (09-30-2012):</h3>
<ul><li>Fix crash when querystring contains a null key <a href="http://t4mvc.codeplex.com/discussions/396916">http://t4mvc.codeplex.com/discussions/396916</a></li></ul>
<h3>2.10.2 (09-17-2012):</h3>
<ul><li>Fix UnbindModel to avoid failing on duplicate entries <a href="http://t4mvc.codeplex.com/discussions/394529">http://t4mvc.codeplex.com/discussions/394529</a></li>
<li>Fix ModelUnbinder code generation when SplitIntoMultipleFiles is false <a href="http://t4mvc.codeplex.com/workitem/9">http://t4mvc.codeplex.com/workitem/9</a></li></ul>
<h3>2.10.1 (07-31-2012):</h3>
<ul><li>Fixed default param regression with model unbinder code (<a href="http://stackoverflow.com/questions/11566207/t4mvc-optionalparameter-values-implied-from-current-context/11603897">http://stackoverflow.com/questions/11566207/t4mvc-optionalparameter-values-implied-from-current-context/11603897</a>)</li></ul>
<h3>2.10.0 (07-03-2012):</h3>
<ul><li>Added support for custom model binders (<a href="https://t4mvc.codeplex.com/discussions/357386">https://t4mvc.codeplex.com/discussions/357386</a>)</li>
<li>Fixed unreachable code warning</li></ul>
<h3>2.9.0 (06-22-2012):</h3>
<ul><li>Added support for minified css files (<a href="https://t4mvc.codeplex.com/discussions/360443">https://t4mvc.codeplex.com/discussions/360443</a>)</li>
<li>Replaced improper new RouteValueDictionary usage on htmlAttributes</li></ul>
<h3>2.8.1 (04-12-2012):</h3>
<ul><li>Also default to https for the default (no param) action overload</li>
<li>Make T4MVCHelpers class public so that test code in a different assembly can access it</li></ul>
<h3>2.8 (03-25-2012):</h3>
<ul><li>Generate parameter constants for action methods. e.g. MVC.MyController.MethodParams.someParam</li>
<li>Default to https for Action Methods marked as RequireHttps (either at controller or action level)</li></ul>
<h3>2.7.0 (03-09-2012):</h3>
<ul><li>Removed support for MVC earlier than 3, and for CLR earlier than 4.0</li>
<li>Fix ActionLink to work with MVC4 (<a href="http://mvccontrib.codeplex.com/workitem/7191">http://mvccontrib.codeplex.com/workitem/7191</a>)</li></ul>
<h3>2.6.68 (02-03-2012):</h3>
<ul><li>Ignore static ctors when looking for ctors (<a href="http://mvccontrib.codeplex.com/workitem/7185">http://mvccontrib.codeplex.com/workitem/7185</a>)</li></ul>
<h3>2.6.67 (12-24-2011):</h3>
<ul><li>Restore Actions token that wasn&#39;t obsolete after all. Oops. (<a href="http://stackoverflow.com/questions/8625462/t4mvc-actions-token">http://stackoverflow.com/questions/8625462/t4mvc-actions-token</a>)</li></ul>
<h3>2.6.66 (12-22-2011):</h3>
<ul><li>Disable constant generation in UseLowercaseRoutes mode (<a href="http://stackoverflow.com/questions/8605868/t4mvc-2-6-65-and-uselowercaseroutes-true-error">http://stackoverflow.com/questions/8605868/t4mvc-2-6-65-and-uselowercaseroutes-true-error</a>)</li>
<li>Remove obsolete Actions token (<a href="http://stackoverflow.com/questions/8536269/what-is-the-difference-between-these-2-definitions-in-t4mvc/8543510">http://stackoverflow.com/questions/8536269/what-is-the-difference-between-these-2-definitions-in-t4mvc/8543510</a>)</li></ul>
<h3>2.6.65 (12-06-2011):</h3>
<ul><li>Add true constant strings for use in attributes (<a href="http://mvccontrib.codeplex.com/workitem/7177">http://mvccontrib.codeplex.com/workitem/7177</a>)</li></ul>
<h3>2.6.64 (10-21-2011):</h3>
<ul><li>Fix issue when action parameter name is escaped using @ syntax (e.g. int @event)</li></ul>
<h3>2.6.63 (10-13-2011):</h3>
<ul><li>Move hard coded T4MVC namespace into settings file</li></ul>
<h3>2.6.62 (08-13-2011):</h3>
<ul><li>Replace some unwanted tab characters with whitespace</li></ul>
<h3>2.6.61 (08-01-2011):</h3>
<ul><li>Ignore generic action methods (<a href="http://mvccontrib.codeplex.com/workitem/7156">http://mvccontrib.codeplex.com/workitem/7156</a>)</li></ul>
<h3>2.6.60 (07-28-2011):</h3>
<ul><li>Added support for portable areas. Enabled by adding area names to PortableAreas in T4MVC.tt.settings.t4</li>
<li>When generating links and views, if the folder name is the same as the parent, add a modifier to avoid class name conflicts (<a href="http://mvccontrib.codeplex.com/workitem/7153">http://mvccontrib.codeplex.com/workitem/7153</a>)</li></ul>
<h3>2.6.59 (07-12-2011):</h3>
<ul><li>Added commented out logic to show how to debug into the template (<a href="http://mvccontrib.codeplex.com/workitem/7144">http://mvccontrib.codeplex.com/workitem/7144</a>)</li>
<li>Ignore any class which name doesn&#39;t end with &quot;Controller&quot;</li></ul>
<h3>2.6.58 (06-24-2011):</h3>
<ul><li>Change the controller detection logic to be more reliable and ignore anything that doesn&#39;t extend Controller.</li></ul>
<h3>2.6.57 (06-21-2011):</h3>
<ul><li>Re-added Html.ActionLink/Url.Action overload without default params to avoid running into &quot;CS0854: An expression tree may not contain a call or invocation that uses optional arguments&quot;</li>
<li>Make ProcessControllerActionMethods look for ControllerBase instead of Controller to support controllers like MailerBase (from ActionMailer) which extend ControllerBase.</li></ul>
<h3>2.6.56 (06-05-2011):</h3>
<ul><li>Added optional Html.ActionLink parameters for protocol, hostname and fragment (<a href="http://stackoverflow.com/questions/6280347/how-can-i-add-a-hash-fragment-to-t4mvc-route-dictionary-actionresult/6302703">http://stackoverflow.com/questions/6280347/how-can-i-add-a-hash-fragment-to-t4mvc-route-dictionary-actionresult/6302703</a>)</li></ul>
<h3>2.6.55 (06-05-2011):</h3>
<ul><li>Added optional Url.Action parameters for protocol and hostname (<a href="http://stackoverflow.com/questions/6240568/t4mvc-doesnt-work-property-with-url-action">http://stackoverflow.com/questions/6240568/t4mvc-doesnt-work-property-with-url-action</a>)</li></ul>
<h3>2.6.54 (04-23-2011):</h3>
<ul><li>Added missing license to NuGet package and fixed some links. No actual template changes!</li></ul>
<h3>2.6.53 (04-18-2011):</h3>
<ul><li>Ignore actions marked as obsolete (<a href="http://mvccontrib.codeplex.com/workitem/7133">http://mvccontrib.codeplex.com/workitem/7133</a>)</li></ul>
<h3>2.6.52 (04-14-2011):</h3>
<ul><li>Moved the &#39;Dummy&#39; class under the GenerateMvcT4Extensions check</li>
<li>Always include the area token in the route values unless running on MVC 1.x</li></ul>
<h3>2.6.51 (04-12-2011):</h3>
<ul><li>Ignore async completion methods as they can&#39;t really be used in T4MVC, and can cause issues (<a href="http://stackoverflow.com/questions/5419173/t4mvc-asynccontroller">http://stackoverflow.com/questions/5419173/t4mvc-asynccontroller</a>)</li></ul>
<h3>2.6.50 (04-08-2011):</h3>
<ul><li>Added AddTimestampToStaticLink() method to settings file to allow more granular decision (per <a href="http://mvccontrib.codeplex.com/workitem/7129">this post</a>)</li>
<li>Added GenerateMvcT4Extensions settings flag to omit the generation of the System.Web.Mvc.T4Extensions class, which can be useful if it is already defined in a referenced library (see <a href="http://stackoverflow.com/questions/5563163/t4mvc-use-extension-methods-in-control-library/5574227">this post</a>)</li></ul>
<h3>2.6.44 (03-10-2011):</h3>
<ul><li>Added UseNonQualifiedViewNames flag which when set to true causes view names never to be fully qualified. Spark users may need that.</li></ul>
<h3>2.6.43 (02-24-2011):</h3>
<ul><li>Renamed T4MVC.settings.t4 to T4MVC.tt.settings.t4 so it feels more like a &#39;child&#39; file of T4MVC.tt</li></ul>
<h3>2.6.42 (02-01-2011):</h3>
<ul><li>Fix partial view support for MVC</li>
<li>Fix partial view support when name has periods (<a href="http://mvccontrib.codeplex.com/workitem/7113">http://mvccontrib.codeplex.com/workitem/7113</a>)</li></ul>
<h3>2.6.41 (01-17-2011):</h3>
<ul><li>Added AJAX BeginForm overloads</li></ul>
<h3>2.6.40 (01-05-2011):</h3>
<ul><li>Added BeginForm overload that just takes an ActionResult</li>
<li>Fix MapRouteArea to use UseNamespaceFallback when there are no namespaces</li></ul>
<h3>2.6.32 (12-15-2010):</h3>
<ul><li>Fix bug in controller name generation when IncludeAreasToken is true</li></ul>
<h3>2.6.31 (11-15-2010):</h3>
<ul><li>Improve error message when T4MVC generated files are out of date.</li>
<li>Changed some &#39;const bool&#39; settings to &#39;static bool&#39; to avoid unused code warnings.</li>
<li>Disabled regen optimization added in 2.6.14 since it doesn&#39;t catch view changes</li></ul>
<h3>2.6.30 (09-05-2010):</h3>
<ul><li>Changed ExplicitHtmlHelpersForPartials flag to be off by default (and fix a small issue when it&#39;s off)</li>
<li>Handled System.NotImplementedException if project type (e.g. Installer) does not implement CodeModel property</li>
<li>Fixed issue when action method params are all optional (<a href="http://stackoverflow.com/questions/3488610/t4mvc-and-named-parameters">http://stackoverflow.com/questions/3488610/t4mvc-and-named-parameters</a>)</li>
<li>Exclude Area related methods when using MVC 1.0, as that was breaking things</li>
<li>Added logic to special case DisplayTemplates/EditorTemplates folders, since they need short view names passed in</li></ul>
<h3>2.6.21 (07-20-2010):</h3>
<ul><li>Fix to the partial extension feature added in 2.6.20 to deal with conflicts</li></ul>
<h3>2.6.20 (07-19-2010):</h3>
<ul><li>Added extension methods to render partial views (see <a href="http://www.weirdlover.com/2010/05/12/t4mvc-extension-for-mvc-partials/">this post</a>)
<ul><li>e.g. Html.RenderPartial(&quot;Map&quot;, Model.Dinner); --&gt; Html.RenderMap(Model.Dinner);</li>
<li>Can be turned off in settings file via ExplicitHtmlHelpersForPartials flag.</li></ul></li></ul>
<h3>2.6.15 (05-16-2010):</h3>
<ul><li>Added missing MapRoute overloads to support namespaces</li>
<li>Added MapRoute extensions on AreaRegistrationContext to support areas. Had to name them MapRouteArea to avoid clash with existing MapRoute methods :(</li></ul>
<h3>2.6.14 (05-06-2010):</h3>
<ul><li>Added UseLowercaseRoutes flag to lower case the area, controller and action names in routes</li>
<li>Added support for Views folders that don&#39;t match a controller name.</li>
<li>Added optimization to not regenerate files when the controller has not changed since the last generation</li>
<li>Turn AlwaysKeepTemplateDirty to false by default. We now have an <a href="http://blogs.msdn.com/davidebb/archive/2010/03/18/an-even-better-way-to-run-t4mvc-a-vs-addin.aspx">addin</a> which provides a better solution to this</li></ul>
<h3>2.6.13 (03-08-2010):</h3>
<ul><li>Added AddTimestampToStaticLinks flag to T4MVC.settings.t4 to generate static links that change when the file changes.</li>
<li>Added support for [Bind(Prefix = &quot;newParamName&quot;)] attribute so it generates the correct route value</li>
<li>Added an AddRouteValues overload that takes NameValueCollection, e.g.
<ul><li>MVC.Home.About().AddRouteValues(Request.QueryString)</li></ul></li>
<li>Added MapRoute overload that supports contraints</li>
<li>Removed some logic to support VS2010 Beta 2. VS2010 RC or later should now be used.</li></ul>
<h3>2.6.12 (01-15-2010):</h3>
<ul><li>Fixed issue where some special project types (e.g. DB projects) were throwing while enumerating over the list</li>
<li>Changed to use GeneratedCode attribute instead of the less correct CompilerGenerated</li>
<li>Fixed CompilerGenerated/DebuggerNonUserCode attributes so they don&#39;t incorrectly affect the control classes</li>
<li>Change to avoid adding area to route if the app is not using areas</li></ul>
<h3>2.6.11 (01-10-2010):</h3>
<ul><li>Added ExcludedStaticFileExtensions setting to T4MVC.settings.t4 to list extensions for which static links should not be generated.</li>
<li>Support configurable name for IT4MVCActionResult, and it being defined externally (for sharing pourpose)</li>
<li>Added DebuggerNonUserCode attribute to generated classes</li>
<li>Improved error handling when trying to call T4MVC method with real ActionResult (previous threw InvalidCast)</li>
<li>Fix issue when overridden action methods were incorrectly marked as virtual</li></ul>
<h3>2.6.10 (01-04-2010):</h3>
<ul><li>Added support for adding arbitrary route parameters to T4MVC actions. e.g.
<ul><li>MVC.Home.About().AddRouteValue(&quot;fooKey&quot;, bar.Foo.Key)</li>
<li>MVC.Home.About().AddRouteValues(new {fooKey = bar.Foo.Key, barKey = bar.Key})</li></ul></li>
<li>Added shorter to refer to controller actions from with the controller itself. e.g.
<ul><li>return RedirectToAction(MVC.MyController.Actions.About()); BECOMES:</li>
<li>return RedirectToAction(Actions.About());</li></ul></li>
<li>What was previously called Actions was renamed to ActionNames (note, that&#39;s a BREAKING CHANGE if you used Actions before!)</li>
<li>Ignore controller methods that are marked with a NonAction attribute</li>
<li>Renamed IT4MVCActionResult.RouteValues to avoid conflict (this should not break anything, as it&#39;s only used internally)</li></ul>
<h3>2.6.03 (12-10-2009):</h3>
<ul><li>Generate full view paths to allow cross controller references
<ul><li>e.g. MVC.Dinners.Views.DinnerForm is now &quot;~/Views/Dinners/DinnerForm.ascx&quot; instead of just &quot;DinnerForm&quot;</li></ul></li>
<li>Fix compile error when a view name is a language keyword (e.g. string.ascx)</li></ul>
<h3>2.6.02 (12-04-2009)</h3>
<ul><li>Added way to get area name from both Area and Controller objects
<ul><li>e.g. MVC.MyArea.Name and MVC.MyArea.MyController.Area</li></ul></li>
<li>Added support for controllers in the default namespace (i.e. no namespace)</li>
<li>Always include the area in the route data, even when it&#39;s null/empty</li></ul>
<h3>2.6.01 (12-02-2009)</h3>
<ul><li>Fix compile error when a custom ActionResult type has a ctor that takes a value type</li></ul>
<h3>2.6.00 (11-28-2009)</h3>
<ul><li>Added support for MVC 2 Areas</li>
<li>Fixed issue where non-existing RenderAction method gets generated on VS2010 Beta 2</li>
<li>Added check to give proper error when attempting to run T4MVC outside VS (e.g. from TextTransform.exe)</li></ul>
<h3>2.5.02 (11-24-2009)</h3>
<ul><li>Change links in comment to point to new T4MVC home and forum</li>
<li>Fix scenario where a View folder as a name that&#39;s a C# keyword</li></ul>
<h3>2.5.01 (11-20-2009)</h3>
<ul><li>Added support for Html.RenderAction and Html.Action (see http://haacked.com/archive/2009/11/18/aspnetmvc2-render-action.aspx)</li>
<li>Fix null ref exception issue when custom ActionResult type doesn&#39;t have any explicit ctors</li></ul>
<h3>2.5.00 (11-16-2009)</h3>
<ul><li>Incorporated Damien Guard&#39;s multiple output manager to (optionally) split output from T4MVC into separate files to improve source control</li>
<li>Added support for minified javascript files in production</li>
<li>Fixed bug occurring when no action is of type ActionResult</li></ul>
<h3>2.4.04 (10-15-2009)</h3>
<ul><li>Added support for MVC 2 by detecting the version and generating slightly different code</li></ul>
<h3>2.4.03 (10-02-2009)</h3>
<ul><li>Added ProcessVirtualPath method to T4MVC.settings.t4 so user can write custom logic to modify client URL&#39;s</li>
<li>Greatly simplified GetProjectContainingT4File logic by using FindProjectItem().</li>
<li>Renamed generated classes to be CLS compliant</li>
<li>Moved most of the doc and versioning comments from T4MVC.tt into the readme.txt file, as it was getting a bit long.</li></ul>
<h3>2.4.02 (09-02-2009)</h3>
<ul><li>Added a setting in T4MVC.settings.t4 to set the namespace that Links get generated in</li>
<li>Added pragma to prevent compiler from complaining about missing Xml comments</li>
<li>Added &lt;auto-generated /&gt; comment to disable StyleCop in generated file</li>
<li>Fixed issue when using a custom ResultType in a custom namespace. Now fully qualifying result types.</li></ul>
<h3>2.4.01 (07-29-2009):</h3>
<ul><li>Put all the generated code in a T4MVC #region. This is useful to tell tools like ReSharper to ignore it.</li>
<li>Fixed issue where controller methods returning generic types cause template to blow up</li>
<li>Added a setting in T4MVC.settings.t4 to turn off the behavior that always keeps the template dirty</li></ul>
<h3>2.4.00 (07-28-2009):</h3>
<ul><li>Added support for configurable settings in a separate T4MVC.settings.t4 file</li>
<li>Added a parameter-less pseudo-action for every action that doesn&#39;t already have a parameter-less overload</li>
<li>Added support for having T4MVC.tt in a sub folder instead of always at the root of the project</li>
<li>Fixed issue when a base controller doesn&#39;t have a default ctor</li>
<li>Added T4Extensions into System.Web.Mvc namespace to fix ambiguous resolution issue </li>
<li>Misc cleanup</li></ul>
<h3>2.3.01 (07-10-2009):</h3>
<ul><li>Fixed issue with <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName&referringTitle=T4MVC_History">ActionName</a> attribute set to non literal string values (e.g. <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName%28SomeConst%20%2b%20%22Abc%22%29&referringTitle=T4MVC_History">ActionName&#40;SomeConst &#43; &#34;Abc&#34;&#41;</a>)</li>
<li>Fixed duplication issue when partial controller classes have a base type which contains action methods</li>
<li>Skip App_LocalResources when processing views</li>
<li>Cleaned up rendering logic</li></ul>
<h3>2.3.00 (07-07-2009):</h3>
<ul><li>Added support for sub view folders</li>
<li>Added support for <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName&referringTitle=T4MVC_History">ActionName</a> attribute</li>
<li>Improved handling when the controller comes from a different project</li>
<li>Don&#39;t try to process generic controller classes</li></ul>
<h3>2.2.03 (07-06-2009):</h3>
<ul><li>Added support for action methods defined on controller base classes</li>
<li>Improved error handling when not able to change actions to virtual and controllers to partial</li></ul>
<h3>2.2.02 (07-01-2009):</h3>
<ul><li>Fixed break caused by incorrect support for derived ActionResult types in 2.2.01</li>
<li>Fixed issue with duplicate view tokens getting generated when you have both foo.aspx and foo.ascx</li></ul>
<h3>2.2.01 (07-01-2009):</h3>
<ul><li>Added support for action methods that return a type derived from ActionResult (as opposed to exactly an ActionResult)</li>
<li>Fixed issue when controller is using partial classes</li>
<li>Fixed folder handling logic to deal with generated files</li>
<li>Fixed issue with folder names that are C# keyword</li>
<li>Throw NotSupportedException instead of NotImplementedException to avoid being viewed as a TODO</li></ul>
<h3>2.2.00 (06-30-2009):</h3>
<ul><li>Added strongly typed support to MapRoute</li>
<li>Changed constructor generation to avoid confusing IoC containers</li>
<li>Fixed issue with empty Content folder</li>
<li>Fixed issue with abstract controller base classes</li></ul>
<h3>2.1.00 (06-29-2009):</h3>
<ul><li>Added Html.BeginForm overloads that use the strongly typed pattern</li>
<li>Added Url() helpers on static resources to increase flexibility</li>
<li>Changed generated constants (view and action names, static files) to be readonly strings</li>
<li>Fixed null ref exception in Solution Folder logic</li></ul>
<h3>2.0.04 (06-28-2009):</h3>
<ul><li>Fixed issue with files and folders with names starting with a digit</li></ul>
<h3>2.0.03 (06-27-2009):</h3>
<ul><li>Rework code element enumeration logic to work around a VS2010 issue. The template should now work with VS2010 beta 1!</li>
<li>Reduced some redundancy in the generated code</li></ul>
<h3>2.0.02 (06-27-2009):</h3>
<ul><li>Added ActionLink overloads that take object instead of dictionary (from both Html and Ajax)</li></ul>
<h3>2.0.01 (06-26-2009):</h3>
<ul><li>Fixed issue with files and folders with invalid identifier characters (e.g. spaces, &#39;-&#39;, &#39;.&#39;)</li></ul>
<h3>2.0.00 (06-26-2009):</h3>
<ul><li>Added support for refactoring in Action methods</li>
<li>The T4 file automatically runs whenever you build, instead of being done manually</li>
<li>Support for strongly typed links to static resources</li>
<li>Fix: supports controllers that are in sub-folders of the Controllers folder and not directly in there</li>
<li>Fix: works better with nested solution folder </li>
<li>Random other small fixes</li></ul>
<h3>1.0.xx (06-17-2009):</h3>
<ul><li>the original based on <a href="http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx">this post</a></li></ul>
</div><div class="ClearBoth"></div>davidebboWed, 07 Aug 2013 23:30:55 GMTUpdated Wiki: T4MVC_History 20130807113055PUpdated Wiki: T4MVC_Twitterhttps://t4mvc.codeplex.com/wikipage?title=T4MVC_Twitter&version=5<div class="wikidoc">
<h2><em>Here are a few awesome tweets from the T4MVC community&hellip;</em></h2>
<p>&nbsp;</p>
<p>&quot;Can't imagine the mess I'd be in without #T4MVC&quot; @StevieMAtHome <a href="http://twitter.com/#!/StevieMAtHome/status/335339364743774208">
17 May 2013</a></p>
<p>&ldquo;I fell in love with T4MVC.. why haven't I used it before? I fell like I missed something.&rdquo; @rafek
<a href="http://twitter.com/#!/rafek/status/295780813134516225" target="_blank">27 Jan 2013</a></p>
<p>&ldquo;Why have I never looked at T4MVC before?&rdquo; @philpursglove <a href="http://twitter.com/#!/philpursglove/status/293339171844661248" target="_blank">
21 Jan 2013</a></p>
<p>&ldquo;Just discovered T4MVC and started putting it to use. It's freeking phenomenal.&rdquo; @ardave2002
<a href="http://twitter.com/#!/ardave2002/status/241021391007264768" target="_blank">
29 Aug 2012</a></p>
<p>&ldquo;Just discovered T4MVC, pretty amazing and I cannot fathom why it's not built into MVC&rdquo; @backpackhasjetz
<a href="http://twitter.com/#!/backpackhasjetz/status/228330259106381824" target="_blank">
25 Jul 2012</a></p>
<p>&ldquo;If your using mvc 3 or 4 please please check out T4MVC its on Nuget and is flippin awesome!&rdquo; @gsuttie
<a href="http://twitter.com/#!/gsuttie/status/206132209202106370" target="_blank">
25 May 2012</a></p>
<p>&ldquo;How did I develop MVC apps before T4MVC?&rdquo; @marcandrewb <a href="http://twitter.com/#!/marcandrewb/status/195539962886762497" target="_blank">
26 Apr 2012</a></p>
<p>&ldquo;Just discovered T4MVC by @davidebbo #how-did-I-live-without-this&rdquo; @chrispaynter
<a href="http://twitter.com/#!/chrispaynter/status/189237431667666944" target="_blank">
8 Apr 2012</a></p>
<p>&ldquo;@gsuttie Never mind bang for your buck, T4MVC is a sonic boom for a few cents.&rdquo; @steviehailey
<a href="http://twitter.com/#!/steviehailey/status/156991025670389760" target="_blank">
10 Jan 2012</a></p>
<p>&ldquo;I rarely agree with code-gen anywhere, but the typed API generated by T4MVC for your projects resources is a win!&rdquo; @demisbellot
<a href="http://twitter.com/#!/demisbellot/status/122071343666696193" target="_blank">
6 Oct 2011</a></p>
<p>&ldquo;@kevinmontrose @samsaffron We're using T4MVC on the Careers side. One thing it does is make all View paths explicit and strongly-typed.&rdquo; @clipperhouse&nbsp;<a href="http://twitter.com/#!/clipperhouse/status/122144267207589888" target="_blank">6
Oct 2011</a></p>
<p>&ldquo;Omg. T4MVC. Why hasn't this come up more often in MVC discussions? http://bit.ly/o3Wll6&rdquo; @Jimmy_Byrd
<a href="http://twitter.com/#!/Jimmy_Byrd/status/93309880823328768" target="_blank">
19 Jul 2011</a></p>
<p>&ldquo;I &lt;3 #T4MVC!&rdquo; @long2know <a href="http://twitter.com/#!/long2know/status/91344007417966592" target="_blank">
13 Jul 2011</a></p>
<p>&ldquo;@bvrhovnik @rok_b Yeah, it does. And T4MVC has immediate benefits with almost no learning curve :)&rdquo; @studiopesec
<a href="http://twitter.com/#!/studiopesec/status/86710483327004673" target="_blank">
1 Jul 2011</a></p>
<p>&ldquo;#MVC3 developers: NuGet @davidebbo's #T4MVC before you write another magicified string!! http://t.co/ew02GZG&rdquo; @vinneyk
<a href="http://twitter.com/#!/vinneyk/status/86530048965877760" target="_blank">
30 Jun 2011</a></p>
</div><div class="ClearBoth"></div>davidebboMon, 24 Jun 2013 15:16:33 GMTUpdated Wiki: T4MVC_Twitter 20130624031633PUpdated Wiki: T4MVC_Historyhttps://t4mvc.codeplex.com/wikipage?title=T4MVC_History&version=32<div class="wikidoc"><h1>T4MVC change history</h1>
<h3>3.7.0 (6-16-2013)</h3>
<ul><li>New AddAllViewsFoldersToStaticFilesFolders flag to include view folder files as static files (off by default) <a href="https://t4mvc.codeplex.com/discussions/445358">https://t4mvc.codeplex.com/discussions/445358</a></li>
<li>New ExcludedViewExtensions setting to not treat certain file extensions as views</li></ul>
<h3>3.6.5 (5-19-2013)</h3>
<ul><li>Use Controller constructor with least number of params. <a href="https://t4mvc.codeplex.com/workitem/22">https://t4mvc.codeplex.com/workitem/22</a></li></ul>
<h3>3.6.4 (5-08-2013)</h3>
<ul><li>Added support for checking files out with Perforce P4VS. <a href="https://t4mvc.codeplex.com/discussions/442992">https://t4mvc.codeplex.com/discussions/442992</a></li></ul>
<h3>3.6.3 (5-08-2013)</h3>
<ul><li>Fix assembly signing</li></ul>
<h3>3.6.2 (5-07-2013)</h3>
<ul><li>Avoid identifier conflict when content file names are similar. <a href="https://t4mvc.codeplex.com/discussions/441214">https://t4mvc.codeplex.com/discussions/441214</a></li></ul>
<h3>3.6.1 (5-03-2013)</h3>
<ul><li>Make actionresult classes partial. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/duncans/T4MVC/contribution/4632">https://t4mvc.codeplex.com/SourceControl/network/forks/duncans/T4MVC/contribution/4632</a></li></ul>
<h3>3.6.0 (4-26-2013)</h3>
<ul><li>Add support for task based actions. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/kev_bite/T4mvcTaskBasedActions/contribution/4564">https://t4mvc.codeplex.com/SourceControl/network/forks/kev_bite/T4mvcTaskBasedActions/contribution/4564</a></li></ul>
<h3>3.5.4 (4-22-2013)</h3>
<ul><li>Make action results internal to avoid cross project conflicts</li></ul>
<h3>3.5.3 (4-19-2013):</h3>
<ul><li>Add support for portable areas without a standard area folder</li></ul>
<h3>3.5.2 (3-07-2013):</h3>
<ul><li>Add support for inherited controller attributes. <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/4194">http://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/4194</a></li></ul>
<h3>3.5.1 (2-25-2013):</h3>
<ul><li>If static files include a timestamp, previously for minified CSS- and JavaScript-files the timestamp was generated by taking the last change time of the unminified file. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4122">https://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4122</a></li></ul>
<h3>3.5.0 (2-08-2013):</h3>
<ul><li>Sign T4MVCExtensions.dll <a href="http://t4mvc.codeplex.com/discussions/432534">http://t4mvc.codeplex.com/discussions/432534</a></li>
<li>Call T4Extension.TimestampString through delegate for unit testing <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4040">http://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4040</a></li></ul>
<h3>3.4.1 (1-31-2013):</h3>
<ul><li>Make T4MVCHelpers internal to avoid cross project conflicts <a href="http://t4mvc.codeplex.com/workitem/17">http://t4mvc.codeplex.com/workitem/17</a></li></ul>
<h3>3.4.0 (1-23-2013):</h3>
<ul><li>Add optional support for async methods <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/3958">https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/3958</a></li>
<li>Generate partial methods to allow custom &quot;overloading&quot; of the return values.</li></ul>
<h3>3.3.0 (1-16-2013):</h3>
<ul><li> Add support for support for model unbinder providers <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/Augi/T4MVCUnbinderProvider/contribution/3879">https://t4mvc.codeplex.com/SourceControl/network/forks/Augi/T4MVCUnbinderProvider/contribution/3879</a></li>
<li> Fix handling of &quot;completed&quot; methods <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/phw/t4mvc/contribution/3922">https://t4mvc.codeplex.com/SourceControl/network/forks/phw/t4mvc/contribution/3922</a></li></ul>
<h3>3.2.1 (12-27-2012):</h3>
<ul><li> Fix issue with VB projects causing exceptions <a href="http://t4mvc.codeplex.com/workitem/7">http://t4mvc.codeplex.com/workitem/7</a></li></ul>
<h3>3.2.0 (12-11-2012):</h3>
<ul><li> Add option to make parameter names constants <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/WayneBrantley/ParameterNamesToConst/contribution/3762">https://t4mvc.codeplex.com/SourceControl/network/forks/WayneBrantley/ParameterNamesToConst/contribution/3762</a></li></ul>
<h3>3.1.0 (12-09-2012):</h3>
<ul><li>Added JavaScriptReplacableUrl helper <a href="http://t4mvc.codeplex.com/discussions/405911">http://t4mvc.codeplex.com/discussions/405911</a></li></ul>
<h3>3.0.3 (11-30-2012):</h3>
<ul><li>Fix to deal with multiple attributes <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/ArtiomChi/t4mvc/contribution/3723">http://t4mvc.codeplex.com/SourceControl/network/forks/ArtiomChi/t4mvc/contribution/3723</a></li></ul>
<h3>3.0.2 (11-17-2012):</h3>
<ul><li>Add support for generic result types <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/ryanrust/T4MVC/contribution/3653">http://t4mvc.codeplex.com/SourceControl/network/forks/ryanrust/T4MVC/contribution/3653</a></li></ul>
<h3>3.0.1 (11-16-2012):</h3>
<ul><li>Fix T4MVC.tt.settings.xml so it only gets generated when needed <a href="https://t4mvc.codeplex.com/discussions/403390">https://t4mvc.codeplex.com/discussions/403390</a></li></ul>
<h3>3.0.0 (11-14-2012):</h3>
<ul><li>Move all the non-dynamic code to a separate T4MVCExtensions.dll assembly</li>
<li>Change generated code brace style to Allman</li>
<li>Added many new RouteLink/BeginRouteForm/RouteUrl helpers</li></ul>
<h3>2.13.0 (10-24-2012):</h3>
<ul><li>Move settings to T4MVC.tt.settings.xml XML file instead of tt file. See doc for details.</li>
<li>Make simple view names available alongside full names, e.g. MVC.Home.Views.SomeView vs MVC.Home.Views.ViewNames.SomeView</li></ul>
<h3>2.12.0 (10-16-2012):</h3>
<ul><li>Add support for static files in nested folders <a href="http://t4mvc.codeplex.com/workitem/6">http://t4mvc.codeplex.com/workitem/6</a></li>
<li>Add MVC 4 bundle starter classes <a href="https://t4mvc.codeplex.com/discussions/399205">https://t4mvc.codeplex.com/discussions/399205</a></li></ul>
<h3>2.11.2 (10-11-2012):</h3>
<ul><li>Removed optional params in ActionLink to support expression trees <a href="http://t4mvc.codeplex.com/workitem/4">http://t4mvc.codeplex.com/workitem/4</a></li>
<li>Change brace style of generated code to Allman</li></ul>
<h3>2.11.1 (10-10-2012):</h3>
<ul><li>Ignore methods that return generic types <a href="http://mvccontrib.codeplex.com/workitem/7178">http://mvccontrib.codeplex.com/workitem/7178</a></li></ul>
<h3>2.11.0 (10-09-2012):</h3>
<ul><li>Corrects the ActionParameters class for overloaded actions to list all parameters and not just the parameters from the first action found.</li></ul>
<h3>2.10.4 (10-05-2012):</h3>
<ul><li>Added attributes so it builds clean under Code Analysis <a href="http://t4mvc.codeplex.com/workitem/10">http://t4mvc.codeplex.com/workitem/10</a></li></ul>
<h3>2.10.3 (09-30-2012):</h3>
<ul><li>Fix crash when querystring contains a null key <a href="http://t4mvc.codeplex.com/discussions/396916">http://t4mvc.codeplex.com/discussions/396916</a></li></ul>
<h3>2.10.2 (09-17-2012):</h3>
<ul><li>Fix UnbindModel to avoid failing on duplicate entries <a href="http://t4mvc.codeplex.com/discussions/394529">http://t4mvc.codeplex.com/discussions/394529</a></li>
<li>Fix ModelUnbinder code generation when SplitIntoMultipleFiles is false <a href="http://t4mvc.codeplex.com/workitem/9">http://t4mvc.codeplex.com/workitem/9</a></li></ul>
<h3>2.10.1 (07-31-2012):</h3>
<ul><li>Fixed default param regression with model unbinder code (<a href="http://stackoverflow.com/questions/11566207/t4mvc-optionalparameter-values-implied-from-current-context/11603897">http://stackoverflow.com/questions/11566207/t4mvc-optionalparameter-values-implied-from-current-context/11603897</a>)</li></ul>
<h3>2.10.0 (07-03-2012):</h3>
<ul><li>Added support for custom model binders (<a href="https://t4mvc.codeplex.com/discussions/357386">https://t4mvc.codeplex.com/discussions/357386</a>)</li>
<li>Fixed unreachable code warning</li></ul>
<h3>2.9.0 (06-22-2012):</h3>
<ul><li>Added support for minified css files (<a href="https://t4mvc.codeplex.com/discussions/360443">https://t4mvc.codeplex.com/discussions/360443</a>)</li>
<li>Replaced improper new RouteValueDictionary usage on htmlAttributes</li></ul>
<h3>2.8.1 (04-12-2012):</h3>
<ul><li>Also default to https for the default (no param) action overload</li>
<li>Make T4MVCHelpers class public so that test code in a different assembly can access it</li></ul>
<h3>2.8 (03-25-2012):</h3>
<ul><li>Generate parameter constants for action methods. e.g. MVC.MyController.MethodParams.someParam</li>
<li>Default to https for Action Methods marked as RequireHttps (either at controller or action level)</li></ul>
<h3>2.7.0 (03-09-2012):</h3>
<ul><li>Removed support for MVC earlier than 3, and for CLR earlier than 4.0</li>
<li>Fix ActionLink to work with MVC4 (<a href="http://mvccontrib.codeplex.com/workitem/7191">http://mvccontrib.codeplex.com/workitem/7191</a>)</li></ul>
<h3>2.6.68 (02-03-2012):</h3>
<ul><li>Ignore static ctors when looking for ctors (<a href="http://mvccontrib.codeplex.com/workitem/7185">http://mvccontrib.codeplex.com/workitem/7185</a>)</li></ul>
<h3>2.6.67 (12-24-2011):</h3>
<ul><li>Restore Actions token that wasn&#39;t obsolete after all. Oops. (<a href="http://stackoverflow.com/questions/8625462/t4mvc-actions-token">http://stackoverflow.com/questions/8625462/t4mvc-actions-token</a>)</li></ul>
<h3>2.6.66 (12-22-2011):</h3>
<ul><li>Disable constant generation in UseLowercaseRoutes mode (<a href="http://stackoverflow.com/questions/8605868/t4mvc-2-6-65-and-uselowercaseroutes-true-error">http://stackoverflow.com/questions/8605868/t4mvc-2-6-65-and-uselowercaseroutes-true-error</a>)</li>
<li>Remove obsolete Actions token (<a href="http://stackoverflow.com/questions/8536269/what-is-the-difference-between-these-2-definitions-in-t4mvc/8543510">http://stackoverflow.com/questions/8536269/what-is-the-difference-between-these-2-definitions-in-t4mvc/8543510</a>)</li></ul>
<h3>2.6.65 (12-06-2011):</h3>
<ul><li>Add true constant strings for use in attributes (<a href="http://mvccontrib.codeplex.com/workitem/7177">http://mvccontrib.codeplex.com/workitem/7177</a>)</li></ul>
<h3>2.6.64 (10-21-2011):</h3>
<ul><li>Fix issue when action parameter name is escaped using @ syntax (e.g. int @event)</li></ul>
<h3>2.6.63 (10-13-2011):</h3>
<ul><li>Move hard coded T4MVC namespace into settings file</li></ul>
<h3>2.6.62 (08-13-2011):</h3>
<ul><li>Replace some unwanted tab characters with whitespace</li></ul>
<h3>2.6.61 (08-01-2011):</h3>
<ul><li>Ignore generic action methods (<a href="http://mvccontrib.codeplex.com/workitem/7156">http://mvccontrib.codeplex.com/workitem/7156</a>)</li></ul>
<h3>2.6.60 (07-28-2011):</h3>
<ul><li>Added support for portable areas. Enabled by adding area names to PortableAreas in T4MVC.tt.settings.t4</li>
<li>When generating links and views, if the folder name is the same as the parent, add a modifier to avoid class name conflicts (<a href="http://mvccontrib.codeplex.com/workitem/7153">http://mvccontrib.codeplex.com/workitem/7153</a>)</li></ul>
<h3>2.6.59 (07-12-2011):</h3>
<ul><li>Added commented out logic to show how to debug into the template (<a href="http://mvccontrib.codeplex.com/workitem/7144">http://mvccontrib.codeplex.com/workitem/7144</a>)</li>
<li>Ignore any class which name doesn&#39;t end with &quot;Controller&quot;</li></ul>
<h3>2.6.58 (06-24-2011):</h3>
<ul><li>Change the controller detection logic to be more reliable and ignore anything that doesn&#39;t extend Controller.</li></ul>
<h3>2.6.57 (06-21-2011):</h3>
<ul><li>Re-added Html.ActionLink/Url.Action overload without default params to avoid running into &quot;CS0854: An expression tree may not contain a call or invocation that uses optional arguments&quot;</li>
<li>Make ProcessControllerActionMethods look for ControllerBase instead of Controller to support controllers like MailerBase (from ActionMailer) which extend ControllerBase.</li></ul>
<h3>2.6.56 (06-05-2011):</h3>
<ul><li>Added optional Html.ActionLink parameters for protocol, hostname and fragment (<a href="http://stackoverflow.com/questions/6280347/how-can-i-add-a-hash-fragment-to-t4mvc-route-dictionary-actionresult/6302703">http://stackoverflow.com/questions/6280347/how-can-i-add-a-hash-fragment-to-t4mvc-route-dictionary-actionresult/6302703</a>)</li></ul>
<h3>2.6.55 (06-05-2011):</h3>
<ul><li>Added optional Url.Action parameters for protocol and hostname (<a href="http://stackoverflow.com/questions/6240568/t4mvc-doesnt-work-property-with-url-action">http://stackoverflow.com/questions/6240568/t4mvc-doesnt-work-property-with-url-action</a>)</li></ul>
<h3>2.6.54 (04-23-2011):</h3>
<ul><li>Added missing license to NuGet package and fixed some links. No actual template changes!</li></ul>
<h3>2.6.53 (04-18-2011):</h3>
<ul><li>Ignore actions marked as obsolete (<a href="http://mvccontrib.codeplex.com/workitem/7133">http://mvccontrib.codeplex.com/workitem/7133</a>)</li></ul>
<h3>2.6.52 (04-14-2011):</h3>
<ul><li>Moved the &#39;Dummy&#39; class under the GenerateMvcT4Extensions check</li>
<li>Always include the area token in the route values unless running on MVC 1.x</li></ul>
<h3>2.6.51 (04-12-2011):</h3>
<ul><li>Ignore async completion methods as they can&#39;t really be used in T4MVC, and can cause issues (<a href="http://stackoverflow.com/questions/5419173/t4mvc-asynccontroller">http://stackoverflow.com/questions/5419173/t4mvc-asynccontroller</a>)</li></ul>
<h3>2.6.50 (04-08-2011):</h3>
<ul><li>Added AddTimestampToStaticLink() method to settings file to allow more granular decision (per <a href="http://mvccontrib.codeplex.com/workitem/7129">this post</a>)</li>
<li>Added GenerateMvcT4Extensions settings flag to omit the generation of the System.Web.Mvc.T4Extensions class, which can be useful if it is already defined in a referenced library (see <a href="http://stackoverflow.com/questions/5563163/t4mvc-use-extension-methods-in-control-library/5574227">this post</a>)</li></ul>
<h3>2.6.44 (03-10-2011):</h3>
<ul><li>Added UseNonQualifiedViewNames flag which when set to true causes view names never to be fully qualified. Spark users may need that.</li></ul>
<h3>2.6.43 (02-24-2011):</h3>
<ul><li>Renamed T4MVC.settings.t4 to T4MVC.tt.settings.t4 so it feels more like a &#39;child&#39; file of T4MVC.tt</li></ul>
<h3>2.6.42 (02-01-2011):</h3>
<ul><li>Fix partial view support for MVC</li>
<li>Fix partial view support when name has periods (<a href="http://mvccontrib.codeplex.com/workitem/7113">http://mvccontrib.codeplex.com/workitem/7113</a>)</li></ul>
<h3>2.6.41 (01-17-2011):</h3>
<ul><li>Added AJAX BeginForm overloads</li></ul>
<h3>2.6.40 (01-05-2011):</h3>
<ul><li>Added BeginForm overload that just takes an ActionResult</li>
<li>Fix MapRouteArea to use UseNamespaceFallback when there are no namespaces</li></ul>
<h3>2.6.32 (12-15-2010):</h3>
<ul><li>Fix bug in controller name generation when IncludeAreasToken is true</li></ul>
<h3>2.6.31 (11-15-2010):</h3>
<ul><li>Improve error message when T4MVC generated files are out of date.</li>
<li>Changed some &#39;const bool&#39; settings to &#39;static bool&#39; to avoid unused code warnings.</li>
<li>Disabled regen optimization added in 2.6.14 since it doesn&#39;t catch view changes</li></ul>
<h3>2.6.30 (09-05-2010):</h3>
<ul><li>Changed ExplicitHtmlHelpersForPartials flag to be off by default (and fix a small issue when it&#39;s off)</li>
<li>Handled System.NotImplementedException if project type (e.g. Installer) does not implement CodeModel property</li>
<li>Fixed issue when action method params are all optional (<a href="http://stackoverflow.com/questions/3488610/t4mvc-and-named-parameters">http://stackoverflow.com/questions/3488610/t4mvc-and-named-parameters</a>)</li>
<li>Exclude Area related methods when using MVC 1.0, as that was breaking things</li>
<li>Added logic to special case DisplayTemplates/EditorTemplates folders, since they need short view names passed in</li></ul>
<h3>2.6.21 (07-20-2010):</h3>
<ul><li>Fix to the partial extension feature added in 2.6.20 to deal with conflicts</li></ul>
<h3>2.6.20 (07-19-2010):</h3>
<ul><li>Added extension methods to render partial views (see <a href="http://www.weirdlover.com/2010/05/12/t4mvc-extension-for-mvc-partials/">this post</a>)
<ul><li>e.g. Html.RenderPartial(&quot;Map&quot;, Model.Dinner); --&gt; Html.RenderMap(Model.Dinner);</li>
<li>Can be turned off in settings file via ExplicitHtmlHelpersForPartials flag.</li></ul></li></ul>
<h3>2.6.15 (05-16-2010):</h3>
<ul><li>Added missing MapRoute overloads to support namespaces</li>
<li>Added MapRoute extensions on AreaRegistrationContext to support areas. Had to name them MapRouteArea to avoid clash with existing MapRoute methods :(</li></ul>
<h3>2.6.14 (05-06-2010):</h3>
<ul><li>Added UseLowercaseRoutes flag to lower case the area, controller and action names in routes</li>
<li>Added support for Views folders that don&#39;t match a controller name.</li>
<li>Added optimization to not regenerate files when the controller has not changed since the last generation</li>
<li>Turn AlwaysKeepTemplateDirty to false by default. We now have an <a href="http://blogs.msdn.com/davidebb/archive/2010/03/18/an-even-better-way-to-run-t4mvc-a-vs-addin.aspx">addin</a> which provides a better solution to this</li></ul>
<h3>2.6.13 (03-08-2010):</h3>
<ul><li>Added AddTimestampToStaticLinks flag to T4MVC.settings.t4 to generate static links that change when the file changes.</li>
<li>Added support for [Bind(Prefix = &quot;newParamName&quot;)] attribute so it generates the correct route value</li>
<li>Added an AddRouteValues overload that takes NameValueCollection, e.g.
<ul><li>MVC.Home.About().AddRouteValues(Request.QueryString)</li></ul></li>
<li>Added MapRoute overload that supports contraints</li>
<li>Removed some logic to support VS2010 Beta 2. VS2010 RC or later should now be used.</li></ul>
<h3>2.6.12 (01-15-2010):</h3>
<ul><li>Fixed issue where some special project types (e.g. DB projects) were throwing while enumerating over the list</li>
<li>Changed to use GeneratedCode attribute instead of the less correct CompilerGenerated</li>
<li>Fixed CompilerGenerated/DebuggerNonUserCode attributes so they don&#39;t incorrectly affect the control classes</li>
<li>Change to avoid adding area to route if the app is not using areas</li></ul>
<h3>2.6.11 (01-10-2010):</h3>
<ul><li>Added ExcludedStaticFileExtensions setting to T4MVC.settings.t4 to list extensions for which static links should not be generated.</li>
<li>Support configurable name for IT4MVCActionResult, and it being defined externally (for sharing pourpose)</li>
<li>Added DebuggerNonUserCode attribute to generated classes</li>
<li>Improved error handling when trying to call T4MVC method with real ActionResult (previous threw InvalidCast)</li>
<li>Fix issue when overridden action methods were incorrectly marked as virtual</li></ul>
<h3>2.6.10 (01-04-2010):</h3>
<ul><li>Added support for adding arbitrary route parameters to T4MVC actions. e.g.
<ul><li>MVC.Home.About().AddRouteValue(&quot;fooKey&quot;, bar.Foo.Key)</li>
<li>MVC.Home.About().AddRouteValues(new {fooKey = bar.Foo.Key, barKey = bar.Key})</li></ul></li>
<li>Added shorter to refer to controller actions from with the controller itself. e.g.
<ul><li>return RedirectToAction(MVC.MyController.Actions.About()); BECOMES:</li>
<li>return RedirectToAction(Actions.About());</li></ul></li>
<li>What was previously called Actions was renamed to ActionNames (note, that&#39;s a BREAKING CHANGE if you used Actions before!)</li>
<li>Ignore controller methods that are marked with a NonAction attribute</li>
<li>Renamed IT4MVCActionResult.RouteValues to avoid conflict (this should not break anything, as it&#39;s only used internally)</li></ul>
<h3>2.6.03 (12-10-2009):</h3>
<ul><li>Generate full view paths to allow cross controller references
<ul><li>e.g. MVC.Dinners.Views.DinnerForm is now &quot;~/Views/Dinners/DinnerForm.ascx&quot; instead of just &quot;DinnerForm&quot;</li></ul></li>
<li>Fix compile error when a view name is a language keyword (e.g. string.ascx)</li></ul>
<h3>2.6.02 (12-04-2009)</h3>
<ul><li>Added way to get area name from both Area and Controller objects
<ul><li>e.g. MVC.MyArea.Name and MVC.MyArea.MyController.Area</li></ul></li>
<li>Added support for controllers in the default namespace (i.e. no namespace)</li>
<li>Always include the area in the route data, even when it&#39;s null/empty</li></ul>
<h3>2.6.01 (12-02-2009)</h3>
<ul><li>Fix compile error when a custom ActionResult type has a ctor that takes a value type</li></ul>
<h3>2.6.00 (11-28-2009)</h3>
<ul><li>Added support for MVC 2 Areas</li>
<li>Fixed issue where non-existing RenderAction method gets generated on VS2010 Beta 2</li>
<li>Added check to give proper error when attempting to run T4MVC outside VS (e.g. from TextTransform.exe)</li></ul>
<h3>2.5.02 (11-24-2009)</h3>
<ul><li>Change links in comment to point to new T4MVC home and forum</li>
<li>Fix scenario where a View folder as a name that&#39;s a C# keyword</li></ul>
<h3>2.5.01 (11-20-2009)</h3>
<ul><li>Added support for Html.RenderAction and Html.Action (see http://haacked.com/archive/2009/11/18/aspnetmvc2-render-action.aspx)</li>
<li>Fix null ref exception issue when custom ActionResult type doesn&#39;t have any explicit ctors</li></ul>
<h3>2.5.00 (11-16-2009)</h3>
<ul><li>Incorporated Damien Guard&#39;s multiple output manager to (optionally) split output from T4MVC into separate files to improve source control</li>
<li>Added support for minified javascript files in production</li>
<li>Fixed bug occurring when no action is of type ActionResult</li></ul>
<h3>2.4.04 (10-15-2009)</h3>
<ul><li>Added support for MVC 2 by detecting the version and generating slightly different code</li></ul>
<h3>2.4.03 (10-02-2009)</h3>
<ul><li>Added ProcessVirtualPath method to T4MVC.settings.t4 so user can write custom logic to modify client URL&#39;s</li>
<li>Greatly simplified GetProjectContainingT4File logic by using FindProjectItem().</li>
<li>Renamed generated classes to be CLS compliant</li>
<li>Moved most of the doc and versioning comments from T4MVC.tt into the readme.txt file, as it was getting a bit long.</li></ul>
<h3>2.4.02 (09-02-2009)</h3>
<ul><li>Added a setting in T4MVC.settings.t4 to set the namespace that Links get generated in</li>
<li>Added pragma to prevent compiler from complaining about missing Xml comments</li>
<li>Added &lt;auto-generated /&gt; comment to disable StyleCop in generated file</li>
<li>Fixed issue when using a custom ResultType in a custom namespace. Now fully qualifying result types.</li></ul>
<h3>2.4.01 (07-29-2009):</h3>
<ul><li>Put all the generated code in a T4MVC #region. This is useful to tell tools like ReSharper to ignore it.</li>
<li>Fixed issue where controller methods returning generic types cause template to blow up</li>
<li>Added a setting in T4MVC.settings.t4 to turn off the behavior that always keeps the template dirty</li></ul>
<h3>2.4.00 (07-28-2009):</h3>
<ul><li>Added support for configurable settings in a separate T4MVC.settings.t4 file</li>
<li>Added a parameter-less pseudo-action for every action that doesn&#39;t already have a parameter-less overload</li>
<li>Added support for having T4MVC.tt in a sub folder instead of always at the root of the project</li>
<li>Fixed issue when a base controller doesn&#39;t have a default ctor</li>
<li>Added T4Extensions into System.Web.Mvc namespace to fix ambiguous resolution issue </li>
<li>Misc cleanup</li></ul>
<h3>2.3.01 (07-10-2009):</h3>
<ul><li>Fixed issue with <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName&referringTitle=T4MVC_History">ActionName</a> attribute set to non literal string values (e.g. <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName%28SomeConst%20%2b%20%22Abc%22%29&referringTitle=T4MVC_History">ActionName&#40;SomeConst &#43; &#34;Abc&#34;&#41;</a>)</li>
<li>Fixed duplication issue when partial controller classes have a base type which contains action methods</li>
<li>Skip App_LocalResources when processing views</li>
<li>Cleaned up rendering logic</li></ul>
<h3>2.3.00 (07-07-2009):</h3>
<ul><li>Added support for sub view folders</li>
<li>Added support for <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName&referringTitle=T4MVC_History">ActionName</a> attribute</li>
<li>Improved handling when the controller comes from a different project</li>
<li>Don&#39;t try to process generic controller classes</li></ul>
<h3>2.2.03 (07-06-2009):</h3>
<ul><li>Added support for action methods defined on controller base classes</li>
<li>Improved error handling when not able to change actions to virtual and controllers to partial</li></ul>
<h3>2.2.02 (07-01-2009):</h3>
<ul><li>Fixed break caused by incorrect support for derived ActionResult types in 2.2.01</li>
<li>Fixed issue with duplicate view tokens getting generated when you have both foo.aspx and foo.ascx</li></ul>
<h3>2.2.01 (07-01-2009):</h3>
<ul><li>Added support for action methods that return a type derived from ActionResult (as opposed to exactly an ActionResult)</li>
<li>Fixed issue when controller is using partial classes</li>
<li>Fixed folder handling logic to deal with generated files</li>
<li>Fixed issue with folder names that are C# keyword</li>
<li>Throw NotSupportedException instead of NotImplementedException to avoid being viewed as a TODO</li></ul>
<h3>2.2.00 (06-30-2009):</h3>
<ul><li>Added strongly typed support to MapRoute</li>
<li>Changed constructor generation to avoid confusing IoC containers</li>
<li>Fixed issue with empty Content folder</li>
<li>Fixed issue with abstract controller base classes</li></ul>
<h3>2.1.00 (06-29-2009):</h3>
<ul><li>Added Html.BeginForm overloads that use the strongly typed pattern</li>
<li>Added Url() helpers on static resources to increase flexibility</li>
<li>Changed generated constants (view and action names, static files) to be readonly strings</li>
<li>Fixed null ref exception in Solution Folder logic</li></ul>
<h3>2.0.04 (06-28-2009):</h3>
<ul><li>Fixed issue with files and folders with names starting with a digit</li></ul>
<h3>2.0.03 (06-27-2009):</h3>
<ul><li>Rework code element enumeration logic to work around a VS2010 issue. The template should now work with VS2010 beta 1!</li>
<li>Reduced some redundancy in the generated code</li></ul>
<h3>2.0.02 (06-27-2009):</h3>
<ul><li>Added ActionLink overloads that take object instead of dictionary (from both Html and Ajax)</li></ul>
<h3>2.0.01 (06-26-2009):</h3>
<ul><li>Fixed issue with files and folders with invalid identifier characters (e.g. spaces, &#39;-&#39;, &#39;.&#39;)</li></ul>
<h3>2.0.00 (06-26-2009):</h3>
<ul><li>Added support for refactoring in Action methods</li>
<li>The T4 file automatically runs whenever you build, instead of being done manually</li>
<li>Support for strongly typed links to static resources</li>
<li>Fix: supports controllers that are in sub-folders of the Controllers folder and not directly in there</li>
<li>Fix: works better with nested solution folder </li>
<li>Random other small fixes</li></ul>
<h3>1.0.xx (06-17-2009):</h3>
<ul><li>the original based on <a href="http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx">this post</a></li></ul>
</div><div class="ClearBoth"></div>davidebboMon, 17 Jun 2013 01:33:09 GMTUpdated Wiki: T4MVC_History 20130617013309AUpdated Wiki: T4MVC_Historyhttps://t4mvc.codeplex.com/wikipage?title=T4MVC_History&version=31<div class="wikidoc"><h1>T4MVC change history</h1>
<h3>3.6.5 (5-19-2013)</h3>
<ul><li>Use Controller constructor with least number of params. <a href="https://t4mvc.codeplex.com/workitem/22">https://t4mvc.codeplex.com/workitem/22</a></li></ul>
<h3>3.6.4 (5-08-2013)</h3>
<ul><li>Added support for checking files out with Perforce P4VS. <a href="https://t4mvc.codeplex.com/discussions/442992">https://t4mvc.codeplex.com/discussions/442992</a></li></ul>
<h3>3.6.3 (5-08-2013)</h3>
<ul><li>Fix assembly signing</li></ul>
<h3>3.6.2 (5-07-2013)</h3>
<ul><li>Avoid identifier conflict when content file names are similar. <a href="https://t4mvc.codeplex.com/discussions/441214">https://t4mvc.codeplex.com/discussions/441214</a></li></ul>
<h3>3.6.1 (5-03-2013)</h3>
<ul><li>Make actionresult classes partial. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/duncans/T4MVC/contribution/4632">https://t4mvc.codeplex.com/SourceControl/network/forks/duncans/T4MVC/contribution/4632</a></li></ul>
<h3>3.6.0 (4-26-2013)</h3>
<ul><li>Add support for task based actions. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/kev_bite/T4mvcTaskBasedActions/contribution/4564">https://t4mvc.codeplex.com/SourceControl/network/forks/kev_bite/T4mvcTaskBasedActions/contribution/4564</a></li></ul>
<h3>3.5.4 (4-22-2013)</h3>
<ul><li>Make action results internal to avoid cross project conflicts</li></ul>
<h3>3.5.3 (4-19-2013):</h3>
<ul><li>Add support for portable areas without a standard area folder</li></ul>
<h3>3.5.2 (3-07-2013):</h3>
<ul><li>Add support for inherited controller attributes. <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/4194">http://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/4194</a></li></ul>
<h3>3.5.1 (2-25-2013):</h3>
<ul><li>If static files include a timestamp, previously for minified CSS- and JavaScript-files the timestamp was generated by taking the last change time of the unminified file. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4122">https://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4122</a></li></ul>
<h3>3.5.0 (2-08-2013):</h3>
<ul><li>Sign T4MVCExtensions.dll <a href="http://t4mvc.codeplex.com/discussions/432534">http://t4mvc.codeplex.com/discussions/432534</a></li>
<li>Call T4Extension.TimestampString through delegate for unit testing <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4040">http://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4040</a></li></ul>
<h3>3.4.1 (1-31-2013):</h3>
<ul><li>Make T4MVCHelpers internal to avoid cross project conflicts <a href="http://t4mvc.codeplex.com/workitem/17">http://t4mvc.codeplex.com/workitem/17</a></li></ul>
<h3>3.4.0 (1-23-2013):</h3>
<ul><li>Add optional support for async methods <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/3958">https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/3958</a></li>
<li>Generate partial methods to allow custom &quot;overloading&quot; of the return values.</li></ul>
<h3>3.3.0 (1-16-2013):</h3>
<ul><li> Add support for support for model unbinder providers <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/Augi/T4MVCUnbinderProvider/contribution/3879">https://t4mvc.codeplex.com/SourceControl/network/forks/Augi/T4MVCUnbinderProvider/contribution/3879</a></li>
<li> Fix handling of &quot;completed&quot; methods <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/phw/t4mvc/contribution/3922">https://t4mvc.codeplex.com/SourceControl/network/forks/phw/t4mvc/contribution/3922</a></li></ul>
<h3>3.2.1 (12-27-2012):</h3>
<ul><li> Fix issue with VB projects causing exceptions <a href="http://t4mvc.codeplex.com/workitem/7">http://t4mvc.codeplex.com/workitem/7</a></li></ul>
<h3>3.2.0 (12-11-2012):</h3>
<ul><li> Add option to make parameter names constants <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/WayneBrantley/ParameterNamesToConst/contribution/3762">https://t4mvc.codeplex.com/SourceControl/network/forks/WayneBrantley/ParameterNamesToConst/contribution/3762</a></li></ul>
<h3>3.1.0 (12-09-2012):</h3>
<ul><li>Added JavaScriptReplacableUrl helper <a href="http://t4mvc.codeplex.com/discussions/405911">http://t4mvc.codeplex.com/discussions/405911</a></li></ul>
<h3>3.0.3 (11-30-2012):</h3>
<ul><li>Fix to deal with multiple attributes <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/ArtiomChi/t4mvc/contribution/3723">http://t4mvc.codeplex.com/SourceControl/network/forks/ArtiomChi/t4mvc/contribution/3723</a></li></ul>
<h3>3.0.2 (11-17-2012):</h3>
<ul><li>Add support for generic result types <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/ryanrust/T4MVC/contribution/3653">http://t4mvc.codeplex.com/SourceControl/network/forks/ryanrust/T4MVC/contribution/3653</a></li></ul>
<h3>3.0.1 (11-16-2012):</h3>
<ul><li>Fix T4MVC.tt.settings.xml so it only gets generated when needed <a href="https://t4mvc.codeplex.com/discussions/403390">https://t4mvc.codeplex.com/discussions/403390</a></li></ul>
<h3>3.0.0 (11-14-2012):</h3>
<ul><li>Move all the non-dynamic code to a separate T4MVCExtensions.dll assembly</li>
<li>Change generated code brace style to Allman</li>
<li>Added many new RouteLink/BeginRouteForm/RouteUrl helpers</li></ul>
<h3>2.13.0 (10-24-2012):</h3>
<ul><li>Move settings to T4MVC.tt.settings.xml XML file instead of tt file. See doc for details.</li>
<li>Make simple view names available alongside full names, e.g. MVC.Home.Views.SomeView vs MVC.Home.Views.ViewNames.SomeView</li></ul>
<h3>2.12.0 (10-16-2012):</h3>
<ul><li>Add support for static files in nested folders <a href="http://t4mvc.codeplex.com/workitem/6">http://t4mvc.codeplex.com/workitem/6</a></li>
<li>Add MVC 4 bundle starter classes <a href="https://t4mvc.codeplex.com/discussions/399205">https://t4mvc.codeplex.com/discussions/399205</a></li></ul>
<h3>2.11.2 (10-11-2012):</h3>
<ul><li>Removed optional params in ActionLink to support expression trees <a href="http://t4mvc.codeplex.com/workitem/4">http://t4mvc.codeplex.com/workitem/4</a></li>
<li>Change brace style of generated code to Allman</li></ul>
<h3>2.11.1 (10-10-2012):</h3>
<ul><li>Ignore methods that return generic types <a href="http://mvccontrib.codeplex.com/workitem/7178">http://mvccontrib.codeplex.com/workitem/7178</a></li></ul>
<h3>2.11.0 (10-09-2012):</h3>
<ul><li>Corrects the ActionParameters class for overloaded actions to list all parameters and not just the parameters from the first action found.</li></ul>
<h3>2.10.4 (10-05-2012):</h3>
<ul><li>Added attributes so it builds clean under Code Analysis <a href="http://t4mvc.codeplex.com/workitem/10">http://t4mvc.codeplex.com/workitem/10</a></li></ul>
<h3>2.10.3 (09-30-2012):</h3>
<ul><li>Fix crash when querystring contains a null key <a href="http://t4mvc.codeplex.com/discussions/396916">http://t4mvc.codeplex.com/discussions/396916</a></li></ul>
<h3>2.10.2 (09-17-2012):</h3>
<ul><li>Fix UnbindModel to avoid failing on duplicate entries <a href="http://t4mvc.codeplex.com/discussions/394529">http://t4mvc.codeplex.com/discussions/394529</a></li>
<li>Fix ModelUnbinder code generation when SplitIntoMultipleFiles is false <a href="http://t4mvc.codeplex.com/workitem/9">http://t4mvc.codeplex.com/workitem/9</a></li></ul>
<h3>2.10.1 (07-31-2012):</h3>
<ul><li>Fixed default param regression with model unbinder code (<a href="http://stackoverflow.com/questions/11566207/t4mvc-optionalparameter-values-implied-from-current-context/11603897">http://stackoverflow.com/questions/11566207/t4mvc-optionalparameter-values-implied-from-current-context/11603897</a>)</li></ul>
<h3>2.10.0 (07-03-2012):</h3>
<ul><li>Added support for custom model binders (<a href="https://t4mvc.codeplex.com/discussions/357386">https://t4mvc.codeplex.com/discussions/357386</a>)</li>
<li>Fixed unreachable code warning</li></ul>
<h3>2.9.0 (06-22-2012):</h3>
<ul><li>Added support for minified css files (<a href="https://t4mvc.codeplex.com/discussions/360443">https://t4mvc.codeplex.com/discussions/360443</a>)</li>
<li>Replaced improper new RouteValueDictionary usage on htmlAttributes</li></ul>
<h3>2.8.1 (04-12-2012):</h3>
<ul><li>Also default to https for the default (no param) action overload</li>
<li>Make T4MVCHelpers class public so that test code in a different assembly can access it</li></ul>
<h3>2.8 (03-25-2012):</h3>
<ul><li>Generate parameter constants for action methods. e.g. MVC.MyController.MethodParams.someParam</li>
<li>Default to https for Action Methods marked as RequireHttps (either at controller or action level)</li></ul>
<h3>2.7.0 (03-09-2012):</h3>
<ul><li>Removed support for MVC earlier than 3, and for CLR earlier than 4.0</li>
<li>Fix ActionLink to work with MVC4 (<a href="http://mvccontrib.codeplex.com/workitem/7191">http://mvccontrib.codeplex.com/workitem/7191</a>)</li></ul>
<h3>2.6.68 (02-03-2012):</h3>
<ul><li>Ignore static ctors when looking for ctors (<a href="http://mvccontrib.codeplex.com/workitem/7185">http://mvccontrib.codeplex.com/workitem/7185</a>)</li></ul>
<h3>2.6.67 (12-24-2011):</h3>
<ul><li>Restore Actions token that wasn&#39;t obsolete after all. Oops. (<a href="http://stackoverflow.com/questions/8625462/t4mvc-actions-token">http://stackoverflow.com/questions/8625462/t4mvc-actions-token</a>)</li></ul>
<h3>2.6.66 (12-22-2011):</h3>
<ul><li>Disable constant generation in UseLowercaseRoutes mode (<a href="http://stackoverflow.com/questions/8605868/t4mvc-2-6-65-and-uselowercaseroutes-true-error">http://stackoverflow.com/questions/8605868/t4mvc-2-6-65-and-uselowercaseroutes-true-error</a>)</li>
<li>Remove obsolete Actions token (<a href="http://stackoverflow.com/questions/8536269/what-is-the-difference-between-these-2-definitions-in-t4mvc/8543510">http://stackoverflow.com/questions/8536269/what-is-the-difference-between-these-2-definitions-in-t4mvc/8543510</a>)</li></ul>
<h3>2.6.65 (12-06-2011):</h3>
<ul><li>Add true constant strings for use in attributes (<a href="http://mvccontrib.codeplex.com/workitem/7177">http://mvccontrib.codeplex.com/workitem/7177</a>)</li></ul>
<h3>2.6.64 (10-21-2011):</h3>
<ul><li>Fix issue when action parameter name is escaped using @ syntax (e.g. int @event)</li></ul>
<h3>2.6.63 (10-13-2011):</h3>
<ul><li>Move hard coded T4MVC namespace into settings file</li></ul>
<h3>2.6.62 (08-13-2011):</h3>
<ul><li>Replace some unwanted tab characters with whitespace</li></ul>
<h3>2.6.61 (08-01-2011):</h3>
<ul><li>Ignore generic action methods (<a href="http://mvccontrib.codeplex.com/workitem/7156">http://mvccontrib.codeplex.com/workitem/7156</a>)</li></ul>
<h3>2.6.60 (07-28-2011):</h3>
<ul><li>Added support for portable areas. Enabled by adding area names to PortableAreas in T4MVC.tt.settings.t4</li>
<li>When generating links and views, if the folder name is the same as the parent, add a modifier to avoid class name conflicts (<a href="http://mvccontrib.codeplex.com/workitem/7153">http://mvccontrib.codeplex.com/workitem/7153</a>)</li></ul>
<h3>2.6.59 (07-12-2011):</h3>
<ul><li>Added commented out logic to show how to debug into the template (<a href="http://mvccontrib.codeplex.com/workitem/7144">http://mvccontrib.codeplex.com/workitem/7144</a>)</li>
<li>Ignore any class which name doesn&#39;t end with &quot;Controller&quot;</li></ul>
<h3>2.6.58 (06-24-2011):</h3>
<ul><li>Change the controller detection logic to be more reliable and ignore anything that doesn&#39;t extend Controller.</li></ul>
<h3>2.6.57 (06-21-2011):</h3>
<ul><li>Re-added Html.ActionLink/Url.Action overload without default params to avoid running into &quot;CS0854: An expression tree may not contain a call or invocation that uses optional arguments&quot;</li>
<li>Make ProcessControllerActionMethods look for ControllerBase instead of Controller to support controllers like MailerBase (from ActionMailer) which extend ControllerBase.</li></ul>
<h3>2.6.56 (06-05-2011):</h3>
<ul><li>Added optional Html.ActionLink parameters for protocol, hostname and fragment (<a href="http://stackoverflow.com/questions/6280347/how-can-i-add-a-hash-fragment-to-t4mvc-route-dictionary-actionresult/6302703">http://stackoverflow.com/questions/6280347/how-can-i-add-a-hash-fragment-to-t4mvc-route-dictionary-actionresult/6302703</a>)</li></ul>
<h3>2.6.55 (06-05-2011):</h3>
<ul><li>Added optional Url.Action parameters for protocol and hostname (<a href="http://stackoverflow.com/questions/6240568/t4mvc-doesnt-work-property-with-url-action">http://stackoverflow.com/questions/6240568/t4mvc-doesnt-work-property-with-url-action</a>)</li></ul>
<h3>2.6.54 (04-23-2011):</h3>
<ul><li>Added missing license to NuGet package and fixed some links. No actual template changes!</li></ul>
<h3>2.6.53 (04-18-2011):</h3>
<ul><li>Ignore actions marked as obsolete (<a href="http://mvccontrib.codeplex.com/workitem/7133">http://mvccontrib.codeplex.com/workitem/7133</a>)</li></ul>
<h3>2.6.52 (04-14-2011):</h3>
<ul><li>Moved the &#39;Dummy&#39; class under the GenerateMvcT4Extensions check</li>
<li>Always include the area token in the route values unless running on MVC 1.x</li></ul>
<h3>2.6.51 (04-12-2011):</h3>
<ul><li>Ignore async completion methods as they can&#39;t really be used in T4MVC, and can cause issues (<a href="http://stackoverflow.com/questions/5419173/t4mvc-asynccontroller">http://stackoverflow.com/questions/5419173/t4mvc-asynccontroller</a>)</li></ul>
<h3>2.6.50 (04-08-2011):</h3>
<ul><li>Added AddTimestampToStaticLink() method to settings file to allow more granular decision (per <a href="http://mvccontrib.codeplex.com/workitem/7129">this post</a>)</li>
<li>Added GenerateMvcT4Extensions settings flag to omit the generation of the System.Web.Mvc.T4Extensions class, which can be useful if it is already defined in a referenced library (see <a href="http://stackoverflow.com/questions/5563163/t4mvc-use-extension-methods-in-control-library/5574227">this post</a>)</li></ul>
<h3>2.6.44 (03-10-2011):</h3>
<ul><li>Added UseNonQualifiedViewNames flag which when set to true causes view names never to be fully qualified. Spark users may need that.</li></ul>
<h3>2.6.43 (02-24-2011):</h3>
<ul><li>Renamed T4MVC.settings.t4 to T4MVC.tt.settings.t4 so it feels more like a &#39;child&#39; file of T4MVC.tt</li></ul>
<h3>2.6.42 (02-01-2011):</h3>
<ul><li>Fix partial view support for MVC</li>
<li>Fix partial view support when name has periods (<a href="http://mvccontrib.codeplex.com/workitem/7113">http://mvccontrib.codeplex.com/workitem/7113</a>)</li></ul>
<h3>2.6.41 (01-17-2011):</h3>
<ul><li>Added AJAX BeginForm overloads</li></ul>
<h3>2.6.40 (01-05-2011):</h3>
<ul><li>Added BeginForm overload that just takes an ActionResult</li>
<li>Fix MapRouteArea to use UseNamespaceFallback when there are no namespaces</li></ul>
<h3>2.6.32 (12-15-2010):</h3>
<ul><li>Fix bug in controller name generation when IncludeAreasToken is true</li></ul>
<h3>2.6.31 (11-15-2010):</h3>
<ul><li>Improve error message when T4MVC generated files are out of date.</li>
<li>Changed some &#39;const bool&#39; settings to &#39;static bool&#39; to avoid unused code warnings.</li>
<li>Disabled regen optimization added in 2.6.14 since it doesn&#39;t catch view changes</li></ul>
<h3>2.6.30 (09-05-2010):</h3>
<ul><li>Changed ExplicitHtmlHelpersForPartials flag to be off by default (and fix a small issue when it&#39;s off)</li>
<li>Handled System.NotImplementedException if project type (e.g. Installer) does not implement CodeModel property</li>
<li>Fixed issue when action method params are all optional (<a href="http://stackoverflow.com/questions/3488610/t4mvc-and-named-parameters">http://stackoverflow.com/questions/3488610/t4mvc-and-named-parameters</a>)</li>
<li>Exclude Area related methods when using MVC 1.0, as that was breaking things</li>
<li>Added logic to special case DisplayTemplates/EditorTemplates folders, since they need short view names passed in</li></ul>
<h3>2.6.21 (07-20-2010):</h3>
<ul><li>Fix to the partial extension feature added in 2.6.20 to deal with conflicts</li></ul>
<h3>2.6.20 (07-19-2010):</h3>
<ul><li>Added extension methods to render partial views (see <a href="http://www.weirdlover.com/2010/05/12/t4mvc-extension-for-mvc-partials/">this post</a>)
<ul><li>e.g. Html.RenderPartial(&quot;Map&quot;, Model.Dinner); --&gt; Html.RenderMap(Model.Dinner);</li>
<li>Can be turned off in settings file via ExplicitHtmlHelpersForPartials flag.</li></ul></li></ul>
<h3>2.6.15 (05-16-2010):</h3>
<ul><li>Added missing MapRoute overloads to support namespaces</li>
<li>Added MapRoute extensions on AreaRegistrationContext to support areas. Had to name them MapRouteArea to avoid clash with existing MapRoute methods :(</li></ul>
<h3>2.6.14 (05-06-2010):</h3>
<ul><li>Added UseLowercaseRoutes flag to lower case the area, controller and action names in routes</li>
<li>Added support for Views folders that don&#39;t match a controller name.</li>
<li>Added optimization to not regenerate files when the controller has not changed since the last generation</li>
<li>Turn AlwaysKeepTemplateDirty to false by default. We now have an <a href="http://blogs.msdn.com/davidebb/archive/2010/03/18/an-even-better-way-to-run-t4mvc-a-vs-addin.aspx">addin</a> which provides a better solution to this</li></ul>
<h3>2.6.13 (03-08-2010):</h3>
<ul><li>Added AddTimestampToStaticLinks flag to T4MVC.settings.t4 to generate static links that change when the file changes.</li>
<li>Added support for [Bind(Prefix = &quot;newParamName&quot;)] attribute so it generates the correct route value</li>
<li>Added an AddRouteValues overload that takes NameValueCollection, e.g.
<ul><li>MVC.Home.About().AddRouteValues(Request.QueryString)</li></ul></li>
<li>Added MapRoute overload that supports contraints</li>
<li>Removed some logic to support VS2010 Beta 2. VS2010 RC or later should now be used.</li></ul>
<h3>2.6.12 (01-15-2010):</h3>
<ul><li>Fixed issue where some special project types (e.g. DB projects) were throwing while enumerating over the list</li>
<li>Changed to use GeneratedCode attribute instead of the less correct CompilerGenerated</li>
<li>Fixed CompilerGenerated/DebuggerNonUserCode attributes so they don&#39;t incorrectly affect the control classes</li>
<li>Change to avoid adding area to route if the app is not using areas</li></ul>
<h3>2.6.11 (01-10-2010):</h3>
<ul><li>Added ExcludedStaticFileExtensions setting to T4MVC.settings.t4 to list extensions for which static links should not be generated.</li>
<li>Support configurable name for IT4MVCActionResult, and it being defined externally (for sharing pourpose)</li>
<li>Added DebuggerNonUserCode attribute to generated classes</li>
<li>Improved error handling when trying to call T4MVC method with real ActionResult (previous threw InvalidCast)</li>
<li>Fix issue when overridden action methods were incorrectly marked as virtual</li></ul>
<h3>2.6.10 (01-04-2010):</h3>
<ul><li>Added support for adding arbitrary route parameters to T4MVC actions. e.g.
<ul><li>MVC.Home.About().AddRouteValue(&quot;fooKey&quot;, bar.Foo.Key)</li>
<li>MVC.Home.About().AddRouteValues(new {fooKey = bar.Foo.Key, barKey = bar.Key})</li></ul></li>
<li>Added shorter to refer to controller actions from with the controller itself. e.g.
<ul><li>return RedirectToAction(MVC.MyController.Actions.About()); BECOMES:</li>
<li>return RedirectToAction(Actions.About());</li></ul></li>
<li>What was previously called Actions was renamed to ActionNames (note, that&#39;s a BREAKING CHANGE if you used Actions before!)</li>
<li>Ignore controller methods that are marked with a NonAction attribute</li>
<li>Renamed IT4MVCActionResult.RouteValues to avoid conflict (this should not break anything, as it&#39;s only used internally)</li></ul>
<h3>2.6.03 (12-10-2009):</h3>
<ul><li>Generate full view paths to allow cross controller references
<ul><li>e.g. MVC.Dinners.Views.DinnerForm is now &quot;~/Views/Dinners/DinnerForm.ascx&quot; instead of just &quot;DinnerForm&quot;</li></ul></li>
<li>Fix compile error when a view name is a language keyword (e.g. string.ascx)</li></ul>
<h3>2.6.02 (12-04-2009)</h3>
<ul><li>Added way to get area name from both Area and Controller objects
<ul><li>e.g. MVC.MyArea.Name and MVC.MyArea.MyController.Area</li></ul></li>
<li>Added support for controllers in the default namespace (i.e. no namespace)</li>
<li>Always include the area in the route data, even when it&#39;s null/empty</li></ul>
<h3>2.6.01 (12-02-2009)</h3>
<ul><li>Fix compile error when a custom ActionResult type has a ctor that takes a value type</li></ul>
<h3>2.6.00 (11-28-2009)</h3>
<ul><li>Added support for MVC 2 Areas</li>
<li>Fixed issue where non-existing RenderAction method gets generated on VS2010 Beta 2</li>
<li>Added check to give proper error when attempting to run T4MVC outside VS (e.g. from TextTransform.exe)</li></ul>
<h3>2.5.02 (11-24-2009)</h3>
<ul><li>Change links in comment to point to new T4MVC home and forum</li>
<li>Fix scenario where a View folder as a name that&#39;s a C# keyword</li></ul>
<h3>2.5.01 (11-20-2009)</h3>
<ul><li>Added support for Html.RenderAction and Html.Action (see http://haacked.com/archive/2009/11/18/aspnetmvc2-render-action.aspx)</li>
<li>Fix null ref exception issue when custom ActionResult type doesn&#39;t have any explicit ctors</li></ul>
<h3>2.5.00 (11-16-2009)</h3>
<ul><li>Incorporated Damien Guard&#39;s multiple output manager to (optionally) split output from T4MVC into separate files to improve source control</li>
<li>Added support for minified javascript files in production</li>
<li>Fixed bug occurring when no action is of type ActionResult</li></ul>
<h3>2.4.04 (10-15-2009)</h3>
<ul><li>Added support for MVC 2 by detecting the version and generating slightly different code</li></ul>
<h3>2.4.03 (10-02-2009)</h3>
<ul><li>Added ProcessVirtualPath method to T4MVC.settings.t4 so user can write custom logic to modify client URL&#39;s</li>
<li>Greatly simplified GetProjectContainingT4File logic by using FindProjectItem().</li>
<li>Renamed generated classes to be CLS compliant</li>
<li>Moved most of the doc and versioning comments from T4MVC.tt into the readme.txt file, as it was getting a bit long.</li></ul>
<h3>2.4.02 (09-02-2009)</h3>
<ul><li>Added a setting in T4MVC.settings.t4 to set the namespace that Links get generated in</li>
<li>Added pragma to prevent compiler from complaining about missing Xml comments</li>
<li>Added &lt;auto-generated /&gt; comment to disable StyleCop in generated file</li>
<li>Fixed issue when using a custom ResultType in a custom namespace. Now fully qualifying result types.</li></ul>
<h3>2.4.01 (07-29-2009):</h3>
<ul><li>Put all the generated code in a T4MVC #region. This is useful to tell tools like ReSharper to ignore it.</li>
<li>Fixed issue where controller methods returning generic types cause template to blow up</li>
<li>Added a setting in T4MVC.settings.t4 to turn off the behavior that always keeps the template dirty</li></ul>
<h3>2.4.00 (07-28-2009):</h3>
<ul><li>Added support for configurable settings in a separate T4MVC.settings.t4 file</li>
<li>Added a parameter-less pseudo-action for every action that doesn&#39;t already have a parameter-less overload</li>
<li>Added support for having T4MVC.tt in a sub folder instead of always at the root of the project</li>
<li>Fixed issue when a base controller doesn&#39;t have a default ctor</li>
<li>Added T4Extensions into System.Web.Mvc namespace to fix ambiguous resolution issue </li>
<li>Misc cleanup</li></ul>
<h3>2.3.01 (07-10-2009):</h3>
<ul><li>Fixed issue with <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName&referringTitle=T4MVC_History">ActionName</a> attribute set to non literal string values (e.g. <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName%28SomeConst%20%2b%20%22Abc%22%29&referringTitle=T4MVC_History">ActionName&#40;SomeConst &#43; &#34;Abc&#34;&#41;</a>)</li>
<li>Fixed duplication issue when partial controller classes have a base type which contains action methods</li>
<li>Skip App_LocalResources when processing views</li>
<li>Cleaned up rendering logic</li></ul>
<h3>2.3.00 (07-07-2009):</h3>
<ul><li>Added support for sub view folders</li>
<li>Added support for <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName&referringTitle=T4MVC_History">ActionName</a> attribute</li>
<li>Improved handling when the controller comes from a different project</li>
<li>Don&#39;t try to process generic controller classes</li></ul>
<h3>2.2.03 (07-06-2009):</h3>
<ul><li>Added support for action methods defined on controller base classes</li>
<li>Improved error handling when not able to change actions to virtual and controllers to partial</li></ul>
<h3>2.2.02 (07-01-2009):</h3>
<ul><li>Fixed break caused by incorrect support for derived ActionResult types in 2.2.01</li>
<li>Fixed issue with duplicate view tokens getting generated when you have both foo.aspx and foo.ascx</li></ul>
<h3>2.2.01 (07-01-2009):</h3>
<ul><li>Added support for action methods that return a type derived from ActionResult (as opposed to exactly an ActionResult)</li>
<li>Fixed issue when controller is using partial classes</li>
<li>Fixed folder handling logic to deal with generated files</li>
<li>Fixed issue with folder names that are C# keyword</li>
<li>Throw NotSupportedException instead of NotImplementedException to avoid being viewed as a TODO</li></ul>
<h3>2.2.00 (06-30-2009):</h3>
<ul><li>Added strongly typed support to MapRoute</li>
<li>Changed constructor generation to avoid confusing IoC containers</li>
<li>Fixed issue with empty Content folder</li>
<li>Fixed issue with abstract controller base classes</li></ul>
<h3>2.1.00 (06-29-2009):</h3>
<ul><li>Added Html.BeginForm overloads that use the strongly typed pattern</li>
<li>Added Url() helpers on static resources to increase flexibility</li>
<li>Changed generated constants (view and action names, static files) to be readonly strings</li>
<li>Fixed null ref exception in Solution Folder logic</li></ul>
<h3>2.0.04 (06-28-2009):</h3>
<ul><li>Fixed issue with files and folders with names starting with a digit</li></ul>
<h3>2.0.03 (06-27-2009):</h3>
<ul><li>Rework code element enumeration logic to work around a VS2010 issue. The template should now work with VS2010 beta 1!</li>
<li>Reduced some redundancy in the generated code</li></ul>
<h3>2.0.02 (06-27-2009):</h3>
<ul><li>Added ActionLink overloads that take object instead of dictionary (from both Html and Ajax)</li></ul>
<h3>2.0.01 (06-26-2009):</h3>
<ul><li>Fixed issue with files and folders with invalid identifier characters (e.g. spaces, &#39;-&#39;, &#39;.&#39;)</li></ul>
<h3>2.0.00 (06-26-2009):</h3>
<ul><li>Added support for refactoring in Action methods</li>
<li>The T4 file automatically runs whenever you build, instead of being done manually</li>
<li>Support for strongly typed links to static resources</li>
<li>Fix: supports controllers that are in sub-folders of the Controllers folder and not directly in there</li>
<li>Fix: works better with nested solution folder </li>
<li>Random other small fixes</li></ul>
<h3>1.0.xx (06-17-2009):</h3>
<ul><li>the original based on <a href="http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx">this post</a></li></ul>
</div><div class="ClearBoth"></div>davidebboSun, 19 May 2013 21:03:19 GMTUpdated Wiki: T4MVC_History 20130519090319PUpdated Wiki: T4MVC_Historyhttps://t4mvc.codeplex.com/wikipage?title=T4MVC_History&version=30<div class="wikidoc"><h1>T4MVC change history</h1>
<h3>3.6.2 (5-07-2013)</h3>
<ul><li>Avoid identifier conflict when content file names are similar. <a href="https://t4mvc.codeplex.com/discussions/441214">https://t4mvc.codeplex.com/discussions/441214</a></li></ul>
<h3>3.6.1 (5-03-2013)</h3>
<ul><li>Make actionresult classes partial. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/duncans/T4MVC/contribution/4632">https://t4mvc.codeplex.com/SourceControl/network/forks/duncans/T4MVC/contribution/4632</a></li></ul>
<h3>3.6.0 (4-26-2013)</h3>
<ul><li>Add support for task based actions. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/kev_bite/T4mvcTaskBasedActions/contribution/4564">https://t4mvc.codeplex.com/SourceControl/network/forks/kev_bite/T4mvcTaskBasedActions/contribution/4564</a></li></ul>
<h3>3.5.4 (4-22-2013)</h3>
<ul><li>Make action results internal to avoid cross project conflicts</li></ul>
<h3>3.5.3 (4-19-2013):</h3>
<ul><li>Add support for portable areas without a standard area folder</li></ul>
<h3>3.5.2 (3-07-2013):</h3>
<ul><li>Add support for inherited controller attributes. <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/4194">http://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/4194</a></li></ul>
<h3>3.5.1 (2-25-2013):</h3>
<ul><li>If static files include a timestamp, previously for minified CSS- and JavaScript-files the timestamp was generated by taking the last change time of the unminified file. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4122">https://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4122</a></li></ul>
<h3>3.5.0 (2-08-2013):</h3>
<ul><li>Sign T4MVCExtensions.dll <a href="http://t4mvc.codeplex.com/discussions/432534">http://t4mvc.codeplex.com/discussions/432534</a></li>
<li>Call T4Extension.TimestampString through delegate for unit testing <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4040">http://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4040</a></li></ul>
<h3>3.4.1 (1-31-2013):</h3>
<ul><li>Make T4MVCHelpers internal to avoid cross project conflicts <a href="http://t4mvc.codeplex.com/workitem/17">http://t4mvc.codeplex.com/workitem/17</a></li></ul>
<h3>3.4.0 (1-23-2013):</h3>
<ul><li>Add optional support for async methods <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/3958">https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/3958</a></li>
<li>Generate partial methods to allow custom &quot;overloading&quot; of the return values.</li></ul>
<h3>3.3.0 (1-16-2013):</h3>
<ul><li> Add support for support for model unbinder providers <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/Augi/T4MVCUnbinderProvider/contribution/3879">https://t4mvc.codeplex.com/SourceControl/network/forks/Augi/T4MVCUnbinderProvider/contribution/3879</a></li>
<li> Fix handling of &quot;completed&quot; methods <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/phw/t4mvc/contribution/3922">https://t4mvc.codeplex.com/SourceControl/network/forks/phw/t4mvc/contribution/3922</a></li></ul>
<h3>3.2.1 (12-27-2012):</h3>
<ul><li> Fix issue with VB projects causing exceptions <a href="http://t4mvc.codeplex.com/workitem/7">http://t4mvc.codeplex.com/workitem/7</a></li></ul>
<h3>3.2.0 (12-11-2012):</h3>
<ul><li> Add option to make parameter names constants <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/WayneBrantley/ParameterNamesToConst/contribution/3762">https://t4mvc.codeplex.com/SourceControl/network/forks/WayneBrantley/ParameterNamesToConst/contribution/3762</a></li></ul>
<h3>3.1.0 (12-09-2012):</h3>
<ul><li>Added JavaScriptReplacableUrl helper <a href="http://t4mvc.codeplex.com/discussions/405911">http://t4mvc.codeplex.com/discussions/405911</a></li></ul>
<h3>3.0.3 (11-30-2012):</h3>
<ul><li>Fix to deal with multiple attributes <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/ArtiomChi/t4mvc/contribution/3723">http://t4mvc.codeplex.com/SourceControl/network/forks/ArtiomChi/t4mvc/contribution/3723</a></li></ul>
<h3>3.0.2 (11-17-2012):</h3>
<ul><li>Add support for generic result types <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/ryanrust/T4MVC/contribution/3653">http://t4mvc.codeplex.com/SourceControl/network/forks/ryanrust/T4MVC/contribution/3653</a></li></ul>
<h3>3.0.1 (11-16-2012):</h3>
<ul><li>Fix T4MVC.tt.settings.xml so it only gets generated when needed <a href="https://t4mvc.codeplex.com/discussions/403390">https://t4mvc.codeplex.com/discussions/403390</a></li></ul>
<h3>3.0.0 (11-14-2012):</h3>
<ul><li>Move all the non-dynamic code to a separate T4MVCExtensions.dll assembly</li>
<li>Change generated code brace style to Allman</li>
<li>Added many new RouteLink/BeginRouteForm/RouteUrl helpers</li></ul>
<h3>2.13.0 (10-24-2012):</h3>
<ul><li>Move settings to T4MVC.tt.settings.xml XML file instead of tt file. See doc for details.</li>
<li>Make simple view names available alongside full names, e.g. MVC.Home.Views.SomeView vs MVC.Home.Views.ViewNames.SomeView</li></ul>
<h3>2.12.0 (10-16-2012):</h3>
<ul><li>Add support for static files in nested folders <a href="http://t4mvc.codeplex.com/workitem/6">http://t4mvc.codeplex.com/workitem/6</a></li>
<li>Add MVC 4 bundle starter classes <a href="https://t4mvc.codeplex.com/discussions/399205">https://t4mvc.codeplex.com/discussions/399205</a></li></ul>
<h3>2.11.2 (10-11-2012):</h3>
<ul><li>Removed optional params in ActionLink to support expression trees <a href="http://t4mvc.codeplex.com/workitem/4">http://t4mvc.codeplex.com/workitem/4</a></li>
<li>Change brace style of generated code to Allman</li></ul>
<h3>2.11.1 (10-10-2012):</h3>
<ul><li>Ignore methods that return generic types <a href="http://mvccontrib.codeplex.com/workitem/7178">http://mvccontrib.codeplex.com/workitem/7178</a></li></ul>
<h3>2.11.0 (10-09-2012):</h3>
<ul><li>Corrects the ActionParameters class for overloaded actions to list all parameters and not just the parameters from the first action found.</li></ul>
<h3>2.10.4 (10-05-2012):</h3>
<ul><li>Added attributes so it builds clean under Code Analysis <a href="http://t4mvc.codeplex.com/workitem/10">http://t4mvc.codeplex.com/workitem/10</a></li></ul>
<h3>2.10.3 (09-30-2012):</h3>
<ul><li>Fix crash when querystring contains a null key <a href="http://t4mvc.codeplex.com/discussions/396916">http://t4mvc.codeplex.com/discussions/396916</a></li></ul>
<h3>2.10.2 (09-17-2012):</h3>
<ul><li>Fix UnbindModel to avoid failing on duplicate entries <a href="http://t4mvc.codeplex.com/discussions/394529">http://t4mvc.codeplex.com/discussions/394529</a></li>
<li>Fix ModelUnbinder code generation when SplitIntoMultipleFiles is false <a href="http://t4mvc.codeplex.com/workitem/9">http://t4mvc.codeplex.com/workitem/9</a></li></ul>
<h3>2.10.1 (07-31-2012):</h3>
<ul><li>Fixed default param regression with model unbinder code (<a href="http://stackoverflow.com/questions/11566207/t4mvc-optionalparameter-values-implied-from-current-context/11603897">http://stackoverflow.com/questions/11566207/t4mvc-optionalparameter-values-implied-from-current-context/11603897</a>)</li></ul>
<h3>2.10.0 (07-03-2012):</h3>
<ul><li>Added support for custom model binders (<a href="https://t4mvc.codeplex.com/discussions/357386">https://t4mvc.codeplex.com/discussions/357386</a>)</li>
<li>Fixed unreachable code warning</li></ul>
<h3>2.9.0 (06-22-2012):</h3>
<ul><li>Added support for minified css files (<a href="https://t4mvc.codeplex.com/discussions/360443">https://t4mvc.codeplex.com/discussions/360443</a>)</li>
<li>Replaced improper new RouteValueDictionary usage on htmlAttributes</li></ul>
<h3>2.8.1 (04-12-2012):</h3>
<ul><li>Also default to https for the default (no param) action overload</li>
<li>Make T4MVCHelpers class public so that test code in a different assembly can access it</li></ul>
<h3>2.8 (03-25-2012):</h3>
<ul><li>Generate parameter constants for action methods. e.g. MVC.MyController.MethodParams.someParam</li>
<li>Default to https for Action Methods marked as RequireHttps (either at controller or action level)</li></ul>
<h3>2.7.0 (03-09-2012):</h3>
<ul><li>Removed support for MVC earlier than 3, and for CLR earlier than 4.0</li>
<li>Fix ActionLink to work with MVC4 (<a href="http://mvccontrib.codeplex.com/workitem/7191">http://mvccontrib.codeplex.com/workitem/7191</a>)</li></ul>
<h3>2.6.68 (02-03-2012):</h3>
<ul><li>Ignore static ctors when looking for ctors (<a href="http://mvccontrib.codeplex.com/workitem/7185">http://mvccontrib.codeplex.com/workitem/7185</a>)</li></ul>
<h3>2.6.67 (12-24-2011):</h3>
<ul><li>Restore Actions token that wasn&#39;t obsolete after all. Oops. (<a href="http://stackoverflow.com/questions/8625462/t4mvc-actions-token">http://stackoverflow.com/questions/8625462/t4mvc-actions-token</a>)</li></ul>
<h3>2.6.66 (12-22-2011):</h3>
<ul><li>Disable constant generation in UseLowercaseRoutes mode (<a href="http://stackoverflow.com/questions/8605868/t4mvc-2-6-65-and-uselowercaseroutes-true-error">http://stackoverflow.com/questions/8605868/t4mvc-2-6-65-and-uselowercaseroutes-true-error</a>)</li>
<li>Remove obsolete Actions token (<a href="http://stackoverflow.com/questions/8536269/what-is-the-difference-between-these-2-definitions-in-t4mvc/8543510">http://stackoverflow.com/questions/8536269/what-is-the-difference-between-these-2-definitions-in-t4mvc/8543510</a>)</li></ul>
<h3>2.6.65 (12-06-2011):</h3>
<ul><li>Add true constant strings for use in attributes (<a href="http://mvccontrib.codeplex.com/workitem/7177">http://mvccontrib.codeplex.com/workitem/7177</a>)</li></ul>
<h3>2.6.64 (10-21-2011):</h3>
<ul><li>Fix issue when action parameter name is escaped using @ syntax (e.g. int @event)</li></ul>
<h3>2.6.63 (10-13-2011):</h3>
<ul><li>Move hard coded T4MVC namespace into settings file</li></ul>
<h3>2.6.62 (08-13-2011):</h3>
<ul><li>Replace some unwanted tab characters with whitespace</li></ul>
<h3>2.6.61 (08-01-2011):</h3>
<ul><li>Ignore generic action methods (<a href="http://mvccontrib.codeplex.com/workitem/7156">http://mvccontrib.codeplex.com/workitem/7156</a>)</li></ul>
<h3>2.6.60 (07-28-2011):</h3>
<ul><li>Added support for portable areas. Enabled by adding area names to PortableAreas in T4MVC.tt.settings.t4</li>
<li>When generating links and views, if the folder name is the same as the parent, add a modifier to avoid class name conflicts (<a href="http://mvccontrib.codeplex.com/workitem/7153">http://mvccontrib.codeplex.com/workitem/7153</a>)</li></ul>
<h3>2.6.59 (07-12-2011):</h3>
<ul><li>Added commented out logic to show how to debug into the template (<a href="http://mvccontrib.codeplex.com/workitem/7144">http://mvccontrib.codeplex.com/workitem/7144</a>)</li>
<li>Ignore any class which name doesn&#39;t end with &quot;Controller&quot;</li></ul>
<h3>2.6.58 (06-24-2011):</h3>
<ul><li>Change the controller detection logic to be more reliable and ignore anything that doesn&#39;t extend Controller.</li></ul>
<h3>2.6.57 (06-21-2011):</h3>
<ul><li>Re-added Html.ActionLink/Url.Action overload without default params to avoid running into &quot;CS0854: An expression tree may not contain a call or invocation that uses optional arguments&quot;</li>
<li>Make ProcessControllerActionMethods look for ControllerBase instead of Controller to support controllers like MailerBase (from ActionMailer) which extend ControllerBase.</li></ul>
<h3>2.6.56 (06-05-2011):</h3>
<ul><li>Added optional Html.ActionLink parameters for protocol, hostname and fragment (<a href="http://stackoverflow.com/questions/6280347/how-can-i-add-a-hash-fragment-to-t4mvc-route-dictionary-actionresult/6302703">http://stackoverflow.com/questions/6280347/how-can-i-add-a-hash-fragment-to-t4mvc-route-dictionary-actionresult/6302703</a>)</li></ul>
<h3>2.6.55 (06-05-2011):</h3>
<ul><li>Added optional Url.Action parameters for protocol and hostname (<a href="http://stackoverflow.com/questions/6240568/t4mvc-doesnt-work-property-with-url-action">http://stackoverflow.com/questions/6240568/t4mvc-doesnt-work-property-with-url-action</a>)</li></ul>
<h3>2.6.54 (04-23-2011):</h3>
<ul><li>Added missing license to NuGet package and fixed some links. No actual template changes!</li></ul>
<h3>2.6.53 (04-18-2011):</h3>
<ul><li>Ignore actions marked as obsolete (<a href="http://mvccontrib.codeplex.com/workitem/7133">http://mvccontrib.codeplex.com/workitem/7133</a>)</li></ul>
<h3>2.6.52 (04-14-2011):</h3>
<ul><li>Moved the &#39;Dummy&#39; class under the GenerateMvcT4Extensions check</li>
<li>Always include the area token in the route values unless running on MVC 1.x</li></ul>
<h3>2.6.51 (04-12-2011):</h3>
<ul><li>Ignore async completion methods as they can&#39;t really be used in T4MVC, and can cause issues (<a href="http://stackoverflow.com/questions/5419173/t4mvc-asynccontroller">http://stackoverflow.com/questions/5419173/t4mvc-asynccontroller</a>)</li></ul>
<h3>2.6.50 (04-08-2011):</h3>
<ul><li>Added AddTimestampToStaticLink() method to settings file to allow more granular decision (per <a href="http://mvccontrib.codeplex.com/workitem/7129">this post</a>)</li>
<li>Added GenerateMvcT4Extensions settings flag to omit the generation of the System.Web.Mvc.T4Extensions class, which can be useful if it is already defined in a referenced library (see <a href="http://stackoverflow.com/questions/5563163/t4mvc-use-extension-methods-in-control-library/5574227">this post</a>)</li></ul>
<h3>2.6.44 (03-10-2011):</h3>
<ul><li>Added UseNonQualifiedViewNames flag which when set to true causes view names never to be fully qualified. Spark users may need that.</li></ul>
<h3>2.6.43 (02-24-2011):</h3>
<ul><li>Renamed T4MVC.settings.t4 to T4MVC.tt.settings.t4 so it feels more like a &#39;child&#39; file of T4MVC.tt</li></ul>
<h3>2.6.42 (02-01-2011):</h3>
<ul><li>Fix partial view support for MVC</li>
<li>Fix partial view support when name has periods (<a href="http://mvccontrib.codeplex.com/workitem/7113">http://mvccontrib.codeplex.com/workitem/7113</a>)</li></ul>
<h3>2.6.41 (01-17-2011):</h3>
<ul><li>Added AJAX BeginForm overloads</li></ul>
<h3>2.6.40 (01-05-2011):</h3>
<ul><li>Added BeginForm overload that just takes an ActionResult</li>
<li>Fix MapRouteArea to use UseNamespaceFallback when there are no namespaces</li></ul>
<h3>2.6.32 (12-15-2010):</h3>
<ul><li>Fix bug in controller name generation when IncludeAreasToken is true</li></ul>
<h3>2.6.31 (11-15-2010):</h3>
<ul><li>Improve error message when T4MVC generated files are out of date.</li>
<li>Changed some &#39;const bool&#39; settings to &#39;static bool&#39; to avoid unused code warnings.</li>
<li>Disabled regen optimization added in 2.6.14 since it doesn&#39;t catch view changes</li></ul>
<h3>2.6.30 (09-05-2010):</h3>
<ul><li>Changed ExplicitHtmlHelpersForPartials flag to be off by default (and fix a small issue when it&#39;s off)</li>
<li>Handled System.NotImplementedException if project type (e.g. Installer) does not implement CodeModel property</li>
<li>Fixed issue when action method params are all optional (<a href="http://stackoverflow.com/questions/3488610/t4mvc-and-named-parameters">http://stackoverflow.com/questions/3488610/t4mvc-and-named-parameters</a>)</li>
<li>Exclude Area related methods when using MVC 1.0, as that was breaking things</li>
<li>Added logic to special case DisplayTemplates/EditorTemplates folders, since they need short view names passed in</li></ul>
<h3>2.6.21 (07-20-2010):</h3>
<ul><li>Fix to the partial extension feature added in 2.6.20 to deal with conflicts</li></ul>
<h3>2.6.20 (07-19-2010):</h3>
<ul><li>Added extension methods to render partial views (see <a href="http://www.weirdlover.com/2010/05/12/t4mvc-extension-for-mvc-partials/">this post</a>)
<ul><li>e.g. Html.RenderPartial(&quot;Map&quot;, Model.Dinner); --&gt; Html.RenderMap(Model.Dinner);</li>
<li>Can be turned off in settings file via ExplicitHtmlHelpersForPartials flag.</li></ul></li></ul>
<h3>2.6.15 (05-16-2010):</h3>
<ul><li>Added missing MapRoute overloads to support namespaces</li>
<li>Added MapRoute extensions on AreaRegistrationContext to support areas. Had to name them MapRouteArea to avoid clash with existing MapRoute methods :(</li></ul>
<h3>2.6.14 (05-06-2010):</h3>
<ul><li>Added UseLowercaseRoutes flag to lower case the area, controller and action names in routes</li>
<li>Added support for Views folders that don&#39;t match a controller name.</li>
<li>Added optimization to not regenerate files when the controller has not changed since the last generation</li>
<li>Turn AlwaysKeepTemplateDirty to false by default. We now have an <a href="http://blogs.msdn.com/davidebb/archive/2010/03/18/an-even-better-way-to-run-t4mvc-a-vs-addin.aspx">addin</a> which provides a better solution to this</li></ul>
<h3>2.6.13 (03-08-2010):</h3>
<ul><li>Added AddTimestampToStaticLinks flag to T4MVC.settings.t4 to generate static links that change when the file changes.</li>
<li>Added support for [Bind(Prefix = &quot;newParamName&quot;)] attribute so it generates the correct route value</li>
<li>Added an AddRouteValues overload that takes NameValueCollection, e.g.
<ul><li>MVC.Home.About().AddRouteValues(Request.QueryString)</li></ul></li>
<li>Added MapRoute overload that supports contraints</li>
<li>Removed some logic to support VS2010 Beta 2. VS2010 RC or later should now be used.</li></ul>
<h3>2.6.12 (01-15-2010):</h3>
<ul><li>Fixed issue where some special project types (e.g. DB projects) were throwing while enumerating over the list</li>
<li>Changed to use GeneratedCode attribute instead of the less correct CompilerGenerated</li>
<li>Fixed CompilerGenerated/DebuggerNonUserCode attributes so they don&#39;t incorrectly affect the control classes</li>
<li>Change to avoid adding area to route if the app is not using areas</li></ul>
<h3>2.6.11 (01-10-2010):</h3>
<ul><li>Added ExcludedStaticFileExtensions setting to T4MVC.settings.t4 to list extensions for which static links should not be generated.</li>
<li>Support configurable name for IT4MVCActionResult, and it being defined externally (for sharing pourpose)</li>
<li>Added DebuggerNonUserCode attribute to generated classes</li>
<li>Improved error handling when trying to call T4MVC method with real ActionResult (previous threw InvalidCast)</li>
<li>Fix issue when overridden action methods were incorrectly marked as virtual</li></ul>
<h3>2.6.10 (01-04-2010):</h3>
<ul><li>Added support for adding arbitrary route parameters to T4MVC actions. e.g.
<ul><li>MVC.Home.About().AddRouteValue(&quot;fooKey&quot;, bar.Foo.Key)</li>
<li>MVC.Home.About().AddRouteValues(new {fooKey = bar.Foo.Key, barKey = bar.Key})</li></ul></li>
<li>Added shorter to refer to controller actions from with the controller itself. e.g.
<ul><li>return RedirectToAction(MVC.MyController.Actions.About()); BECOMES:</li>
<li>return RedirectToAction(Actions.About());</li></ul></li>
<li>What was previously called Actions was renamed to ActionNames (note, that&#39;s a BREAKING CHANGE if you used Actions before!)</li>
<li>Ignore controller methods that are marked with a NonAction attribute</li>
<li>Renamed IT4MVCActionResult.RouteValues to avoid conflict (this should not break anything, as it&#39;s only used internally)</li></ul>
<h3>2.6.03 (12-10-2009):</h3>
<ul><li>Generate full view paths to allow cross controller references
<ul><li>e.g. MVC.Dinners.Views.DinnerForm is now &quot;~/Views/Dinners/DinnerForm.ascx&quot; instead of just &quot;DinnerForm&quot;</li></ul></li>
<li>Fix compile error when a view name is a language keyword (e.g. string.ascx)</li></ul>
<h3>2.6.02 (12-04-2009)</h3>
<ul><li>Added way to get area name from both Area and Controller objects
<ul><li>e.g. MVC.MyArea.Name and MVC.MyArea.MyController.Area</li></ul></li>
<li>Added support for controllers in the default namespace (i.e. no namespace)</li>
<li>Always include the area in the route data, even when it&#39;s null/empty</li></ul>
<h3>2.6.01 (12-02-2009)</h3>
<ul><li>Fix compile error when a custom ActionResult type has a ctor that takes a value type</li></ul>
<h3>2.6.00 (11-28-2009)</h3>
<ul><li>Added support for MVC 2 Areas</li>
<li>Fixed issue where non-existing RenderAction method gets generated on VS2010 Beta 2</li>
<li>Added check to give proper error when attempting to run T4MVC outside VS (e.g. from TextTransform.exe)</li></ul>
<h3>2.5.02 (11-24-2009)</h3>
<ul><li>Change links in comment to point to new T4MVC home and forum</li>
<li>Fix scenario where a View folder as a name that&#39;s a C# keyword</li></ul>
<h3>2.5.01 (11-20-2009)</h3>
<ul><li>Added support for Html.RenderAction and Html.Action (see http://haacked.com/archive/2009/11/18/aspnetmvc2-render-action.aspx)</li>
<li>Fix null ref exception issue when custom ActionResult type doesn&#39;t have any explicit ctors</li></ul>
<h3>2.5.00 (11-16-2009)</h3>
<ul><li>Incorporated Damien Guard&#39;s multiple output manager to (optionally) split output from T4MVC into separate files to improve source control</li>
<li>Added support for minified javascript files in production</li>
<li>Fixed bug occurring when no action is of type ActionResult</li></ul>
<h3>2.4.04 (10-15-2009)</h3>
<ul><li>Added support for MVC 2 by detecting the version and generating slightly different code</li></ul>
<h3>2.4.03 (10-02-2009)</h3>
<ul><li>Added ProcessVirtualPath method to T4MVC.settings.t4 so user can write custom logic to modify client URL&#39;s</li>
<li>Greatly simplified GetProjectContainingT4File logic by using FindProjectItem().</li>
<li>Renamed generated classes to be CLS compliant</li>
<li>Moved most of the doc and versioning comments from T4MVC.tt into the readme.txt file, as it was getting a bit long.</li></ul>
<h3>2.4.02 (09-02-2009)</h3>
<ul><li>Added a setting in T4MVC.settings.t4 to set the namespace that Links get generated in</li>
<li>Added pragma to prevent compiler from complaining about missing Xml comments</li>
<li>Added &lt;auto-generated /&gt; comment to disable StyleCop in generated file</li>
<li>Fixed issue when using a custom ResultType in a custom namespace. Now fully qualifying result types.</li></ul>
<h3>2.4.01 (07-29-2009):</h3>
<ul><li>Put all the generated code in a T4MVC #region. This is useful to tell tools like ReSharper to ignore it.</li>
<li>Fixed issue where controller methods returning generic types cause template to blow up</li>
<li>Added a setting in T4MVC.settings.t4 to turn off the behavior that always keeps the template dirty</li></ul>
<h3>2.4.00 (07-28-2009):</h3>
<ul><li>Added support for configurable settings in a separate T4MVC.settings.t4 file</li>
<li>Added a parameter-less pseudo-action for every action that doesn&#39;t already have a parameter-less overload</li>
<li>Added support for having T4MVC.tt in a sub folder instead of always at the root of the project</li>
<li>Fixed issue when a base controller doesn&#39;t have a default ctor</li>
<li>Added T4Extensions into System.Web.Mvc namespace to fix ambiguous resolution issue </li>
<li>Misc cleanup</li></ul>
<h3>2.3.01 (07-10-2009):</h3>
<ul><li>Fixed issue with <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName&referringTitle=T4MVC_History">ActionName</a> attribute set to non literal string values (e.g. <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName%28SomeConst%20%2b%20%22Abc%22%29&referringTitle=T4MVC_History">ActionName&#40;SomeConst &#43; &#34;Abc&#34;&#41;</a>)</li>
<li>Fixed duplication issue when partial controller classes have a base type which contains action methods</li>
<li>Skip App_LocalResources when processing views</li>
<li>Cleaned up rendering logic</li></ul>
<h3>2.3.00 (07-07-2009):</h3>
<ul><li>Added support for sub view folders</li>
<li>Added support for <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName&referringTitle=T4MVC_History">ActionName</a> attribute</li>
<li>Improved handling when the controller comes from a different project</li>
<li>Don&#39;t try to process generic controller classes</li></ul>
<h3>2.2.03 (07-06-2009):</h3>
<ul><li>Added support for action methods defined on controller base classes</li>
<li>Improved error handling when not able to change actions to virtual and controllers to partial</li></ul>
<h3>2.2.02 (07-01-2009):</h3>
<ul><li>Fixed break caused by incorrect support for derived ActionResult types in 2.2.01</li>
<li>Fixed issue with duplicate view tokens getting generated when you have both foo.aspx and foo.ascx</li></ul>
<h3>2.2.01 (07-01-2009):</h3>
<ul><li>Added support for action methods that return a type derived from ActionResult (as opposed to exactly an ActionResult)</li>
<li>Fixed issue when controller is using partial classes</li>
<li>Fixed folder handling logic to deal with generated files</li>
<li>Fixed issue with folder names that are C# keyword</li>
<li>Throw NotSupportedException instead of NotImplementedException to avoid being viewed as a TODO</li></ul>
<h3>2.2.00 (06-30-2009):</h3>
<ul><li>Added strongly typed support to MapRoute</li>
<li>Changed constructor generation to avoid confusing IoC containers</li>
<li>Fixed issue with empty Content folder</li>
<li>Fixed issue with abstract controller base classes</li></ul>
<h3>2.1.00 (06-29-2009):</h3>
<ul><li>Added Html.BeginForm overloads that use the strongly typed pattern</li>
<li>Added Url() helpers on static resources to increase flexibility</li>
<li>Changed generated constants (view and action names, static files) to be readonly strings</li>
<li>Fixed null ref exception in Solution Folder logic</li></ul>
<h3>2.0.04 (06-28-2009):</h3>
<ul><li>Fixed issue with files and folders with names starting with a digit</li></ul>
<h3>2.0.03 (06-27-2009):</h3>
<ul><li>Rework code element enumeration logic to work around a VS2010 issue. The template should now work with VS2010 beta 1!</li>
<li>Reduced some redundancy in the generated code</li></ul>
<h3>2.0.02 (06-27-2009):</h3>
<ul><li>Added ActionLink overloads that take object instead of dictionary (from both Html and Ajax)</li></ul>
<h3>2.0.01 (06-26-2009):</h3>
<ul><li>Fixed issue with files and folders with invalid identifier characters (e.g. spaces, &#39;-&#39;, &#39;.&#39;)</li></ul>
<h3>2.0.00 (06-26-2009):</h3>
<ul><li>Added support for refactoring in Action methods</li>
<li>The T4 file automatically runs whenever you build, instead of being done manually</li>
<li>Support for strongly typed links to static resources</li>
<li>Fix: supports controllers that are in sub-folders of the Controllers folder and not directly in there</li>
<li>Fix: works better with nested solution folder </li>
<li>Random other small fixes</li></ul>
<h3>1.0.xx (06-17-2009):</h3>
<ul><li>the original based on <a href="http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx">this post</a></li></ul>
</div><div class="ClearBoth"></div>davidebboWed, 08 May 2013 06:36:37 GMTUpdated Wiki: T4MVC_History 20130508063637AUpdated Wiki: T4MVC_Historyhttps://t4mvc.codeplex.com/wikipage?title=T4MVC_History&version=29<div class="wikidoc"><h1>T4MVC change history</h1>
<h3>3.6.1 (5-03-2013)</h3>
<ul><li>Make actionresult classes partial. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/duncans/T4MVC/contribution/4632">https://t4mvc.codeplex.com/SourceControl/network/forks/duncans/T4MVC/contribution/4632</a></li></ul>
<h3>3.6.0 (4-26-2013)</h3>
<ul><li>Add support for task based actions. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/kev_bite/T4mvcTaskBasedActions/contribution/4564">https://t4mvc.codeplex.com/SourceControl/network/forks/kev_bite/T4mvcTaskBasedActions/contribution/4564</a></li></ul>
<h3>3.5.4 (4-22-2013)</h3>
<ul><li>Make action results internal to avoid cross project conflicts</li></ul>
<h3>3.5.3 (4-19-2013):</h3>
<ul><li>Add support for portable areas without a standard area folder</li></ul>
<h3>3.5.2 (3-07-2013):</h3>
<ul><li>Add support for inherited controller attributes. <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/4194">http://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/4194</a></li></ul>
<h3>3.5.1 (2-25-2013):</h3>
<ul><li>If static files include a timestamp, previously for minified CSS- and JavaScript-files the timestamp was generated by taking the last change time of the unminified file. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4122">https://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4122</a></li></ul>
<h3>3.5.0 (2-08-2013):</h3>
<ul><li>Sign T4MVCExtensions.dll <a href="http://t4mvc.codeplex.com/discussions/432534">http://t4mvc.codeplex.com/discussions/432534</a></li>
<li>Call T4Extension.TimestampString through delegate for unit testing <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4040">http://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4040</a></li></ul>
<h3>3.4.1 (1-31-2013):</h3>
<ul><li>Make T4MVCHelpers internal to avoid cross project conflicts <a href="http://t4mvc.codeplex.com/workitem/17">http://t4mvc.codeplex.com/workitem/17</a></li></ul>
<h3>3.4.0 (1-23-2013):</h3>
<ul><li>Add optional support for async methods <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/3958">https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/3958</a></li>
<li>Generate partial methods to allow custom &quot;overloading&quot; of the return values.</li></ul>
<h3>3.3.0 (1-16-2013):</h3>
<ul><li> Add support for support for model unbinder providers <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/Augi/T4MVCUnbinderProvider/contribution/3879">https://t4mvc.codeplex.com/SourceControl/network/forks/Augi/T4MVCUnbinderProvider/contribution/3879</a></li>
<li> Fix handling of &quot;completed&quot; methods <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/phw/t4mvc/contribution/3922">https://t4mvc.codeplex.com/SourceControl/network/forks/phw/t4mvc/contribution/3922</a></li></ul>
<h3>3.2.1 (12-27-2012):</h3>
<ul><li> Fix issue with VB projects causing exceptions <a href="http://t4mvc.codeplex.com/workitem/7">http://t4mvc.codeplex.com/workitem/7</a></li></ul>
<h3>3.2.0 (12-11-2012):</h3>
<ul><li> Add option to make parameter names constants <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/WayneBrantley/ParameterNamesToConst/contribution/3762">https://t4mvc.codeplex.com/SourceControl/network/forks/WayneBrantley/ParameterNamesToConst/contribution/3762</a></li></ul>
<h3>3.1.0 (12-09-2012):</h3>
<ul><li>Added JavaScriptReplacableUrl helper <a href="http://t4mvc.codeplex.com/discussions/405911">http://t4mvc.codeplex.com/discussions/405911</a></li></ul>
<h3>3.0.3 (11-30-2012):</h3>
<ul><li>Fix to deal with multiple attributes <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/ArtiomChi/t4mvc/contribution/3723">http://t4mvc.codeplex.com/SourceControl/network/forks/ArtiomChi/t4mvc/contribution/3723</a></li></ul>
<h3>3.0.2 (11-17-2012):</h3>
<ul><li>Add support for generic result types <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/ryanrust/T4MVC/contribution/3653">http://t4mvc.codeplex.com/SourceControl/network/forks/ryanrust/T4MVC/contribution/3653</a></li></ul>
<h3>3.0.1 (11-16-2012):</h3>
<ul><li>Fix T4MVC.tt.settings.xml so it only gets generated when needed <a href="https://t4mvc.codeplex.com/discussions/403390">https://t4mvc.codeplex.com/discussions/403390</a></li></ul>
<h3>3.0.0 (11-14-2012):</h3>
<ul><li>Move all the non-dynamic code to a separate T4MVCExtensions.dll assembly</li>
<li>Change generated code brace style to Allman</li>
<li>Added many new RouteLink/BeginRouteForm/RouteUrl helpers</li></ul>
<h3>2.13.0 (10-24-2012):</h3>
<ul><li>Move settings to T4MVC.tt.settings.xml XML file instead of tt file. See doc for details.</li>
<li>Make simple view names available alongside full names, e.g. MVC.Home.Views.SomeView vs MVC.Home.Views.ViewNames.SomeView</li></ul>
<h3>2.12.0 (10-16-2012):</h3>
<ul><li>Add support for static files in nested folders <a href="http://t4mvc.codeplex.com/workitem/6">http://t4mvc.codeplex.com/workitem/6</a></li>
<li>Add MVC 4 bundle starter classes <a href="https://t4mvc.codeplex.com/discussions/399205">https://t4mvc.codeplex.com/discussions/399205</a></li></ul>
<h3>2.11.2 (10-11-2012):</h3>
<ul><li>Removed optional params in ActionLink to support expression trees <a href="http://t4mvc.codeplex.com/workitem/4">http://t4mvc.codeplex.com/workitem/4</a></li>
<li>Change brace style of generated code to Allman</li></ul>
<h3>2.11.1 (10-10-2012):</h3>
<ul><li>Ignore methods that return generic types <a href="http://mvccontrib.codeplex.com/workitem/7178">http://mvccontrib.codeplex.com/workitem/7178</a></li></ul>
<h3>2.11.0 (10-09-2012):</h3>
<ul><li>Corrects the ActionParameters class for overloaded actions to list all parameters and not just the parameters from the first action found.</li></ul>
<h3>2.10.4 (10-05-2012):</h3>
<ul><li>Added attributes so it builds clean under Code Analysis <a href="http://t4mvc.codeplex.com/workitem/10">http://t4mvc.codeplex.com/workitem/10</a></li></ul>
<h3>2.10.3 (09-30-2012):</h3>
<ul><li>Fix crash when querystring contains a null key <a href="http://t4mvc.codeplex.com/discussions/396916">http://t4mvc.codeplex.com/discussions/396916</a></li></ul>
<h3>2.10.2 (09-17-2012):</h3>
<ul><li>Fix UnbindModel to avoid failing on duplicate entries <a href="http://t4mvc.codeplex.com/discussions/394529">http://t4mvc.codeplex.com/discussions/394529</a></li>
<li>Fix ModelUnbinder code generation when SplitIntoMultipleFiles is false <a href="http://t4mvc.codeplex.com/workitem/9">http://t4mvc.codeplex.com/workitem/9</a></li></ul>
<h3>2.10.1 (07-31-2012):</h3>
<ul><li>Fixed default param regression with model unbinder code (<a href="http://stackoverflow.com/questions/11566207/t4mvc-optionalparameter-values-implied-from-current-context/11603897">http://stackoverflow.com/questions/11566207/t4mvc-optionalparameter-values-implied-from-current-context/11603897</a>)</li></ul>
<h3>2.10.0 (07-03-2012):</h3>
<ul><li>Added support for custom model binders (<a href="https://t4mvc.codeplex.com/discussions/357386">https://t4mvc.codeplex.com/discussions/357386</a>)</li>
<li>Fixed unreachable code warning</li></ul>
<h3>2.9.0 (06-22-2012):</h3>
<ul><li>Added support for minified css files (<a href="https://t4mvc.codeplex.com/discussions/360443">https://t4mvc.codeplex.com/discussions/360443</a>)</li>
<li>Replaced improper new RouteValueDictionary usage on htmlAttributes</li></ul>
<h3>2.8.1 (04-12-2012):</h3>
<ul><li>Also default to https for the default (no param) action overload</li>
<li>Make T4MVCHelpers class public so that test code in a different assembly can access it</li></ul>
<h3>2.8 (03-25-2012):</h3>
<ul><li>Generate parameter constants for action methods. e.g. MVC.MyController.MethodParams.someParam</li>
<li>Default to https for Action Methods marked as RequireHttps (either at controller or action level)</li></ul>
<h3>2.7.0 (03-09-2012):</h3>
<ul><li>Removed support for MVC earlier than 3, and for CLR earlier than 4.0</li>
<li>Fix ActionLink to work with MVC4 (<a href="http://mvccontrib.codeplex.com/workitem/7191">http://mvccontrib.codeplex.com/workitem/7191</a>)</li></ul>
<h3>2.6.68 (02-03-2012):</h3>
<ul><li>Ignore static ctors when looking for ctors (<a href="http://mvccontrib.codeplex.com/workitem/7185">http://mvccontrib.codeplex.com/workitem/7185</a>)</li></ul>
<h3>2.6.67 (12-24-2011):</h3>
<ul><li>Restore Actions token that wasn&#39;t obsolete after all. Oops. (<a href="http://stackoverflow.com/questions/8625462/t4mvc-actions-token">http://stackoverflow.com/questions/8625462/t4mvc-actions-token</a>)</li></ul>
<h3>2.6.66 (12-22-2011):</h3>
<ul><li>Disable constant generation in UseLowercaseRoutes mode (<a href="http://stackoverflow.com/questions/8605868/t4mvc-2-6-65-and-uselowercaseroutes-true-error">http://stackoverflow.com/questions/8605868/t4mvc-2-6-65-and-uselowercaseroutes-true-error</a>)</li>
<li>Remove obsolete Actions token (<a href="http://stackoverflow.com/questions/8536269/what-is-the-difference-between-these-2-definitions-in-t4mvc/8543510">http://stackoverflow.com/questions/8536269/what-is-the-difference-between-these-2-definitions-in-t4mvc/8543510</a>)</li></ul>
<h3>2.6.65 (12-06-2011):</h3>
<ul><li>Add true constant strings for use in attributes (<a href="http://mvccontrib.codeplex.com/workitem/7177">http://mvccontrib.codeplex.com/workitem/7177</a>)</li></ul>
<h3>2.6.64 (10-21-2011):</h3>
<ul><li>Fix issue when action parameter name is escaped using @ syntax (e.g. int @event)</li></ul>
<h3>2.6.63 (10-13-2011):</h3>
<ul><li>Move hard coded T4MVC namespace into settings file</li></ul>
<h3>2.6.62 (08-13-2011):</h3>
<ul><li>Replace some unwanted tab characters with whitespace</li></ul>
<h3>2.6.61 (08-01-2011):</h3>
<ul><li>Ignore generic action methods (<a href="http://mvccontrib.codeplex.com/workitem/7156">http://mvccontrib.codeplex.com/workitem/7156</a>)</li></ul>
<h3>2.6.60 (07-28-2011):</h3>
<ul><li>Added support for portable areas. Enabled by adding area names to PortableAreas in T4MVC.tt.settings.t4</li>
<li>When generating links and views, if the folder name is the same as the parent, add a modifier to avoid class name conflicts (<a href="http://mvccontrib.codeplex.com/workitem/7153">http://mvccontrib.codeplex.com/workitem/7153</a>)</li></ul>
<h3>2.6.59 (07-12-2011):</h3>
<ul><li>Added commented out logic to show how to debug into the template (<a href="http://mvccontrib.codeplex.com/workitem/7144">http://mvccontrib.codeplex.com/workitem/7144</a>)</li>
<li>Ignore any class which name doesn&#39;t end with &quot;Controller&quot;</li></ul>
<h3>2.6.58 (06-24-2011):</h3>
<ul><li>Change the controller detection logic to be more reliable and ignore anything that doesn&#39;t extend Controller.</li></ul>
<h3>2.6.57 (06-21-2011):</h3>
<ul><li>Re-added Html.ActionLink/Url.Action overload without default params to avoid running into &quot;CS0854: An expression tree may not contain a call or invocation that uses optional arguments&quot;</li>
<li>Make ProcessControllerActionMethods look for ControllerBase instead of Controller to support controllers like MailerBase (from ActionMailer) which extend ControllerBase.</li></ul>
<h3>2.6.56 (06-05-2011):</h3>
<ul><li>Added optional Html.ActionLink parameters for protocol, hostname and fragment (<a href="http://stackoverflow.com/questions/6280347/how-can-i-add-a-hash-fragment-to-t4mvc-route-dictionary-actionresult/6302703">http://stackoverflow.com/questions/6280347/how-can-i-add-a-hash-fragment-to-t4mvc-route-dictionary-actionresult/6302703</a>)</li></ul>
<h3>2.6.55 (06-05-2011):</h3>
<ul><li>Added optional Url.Action parameters for protocol and hostname (<a href="http://stackoverflow.com/questions/6240568/t4mvc-doesnt-work-property-with-url-action">http://stackoverflow.com/questions/6240568/t4mvc-doesnt-work-property-with-url-action</a>)</li></ul>
<h3>2.6.54 (04-23-2011):</h3>
<ul><li>Added missing license to NuGet package and fixed some links. No actual template changes!</li></ul>
<h3>2.6.53 (04-18-2011):</h3>
<ul><li>Ignore actions marked as obsolete (<a href="http://mvccontrib.codeplex.com/workitem/7133">http://mvccontrib.codeplex.com/workitem/7133</a>)</li></ul>
<h3>2.6.52 (04-14-2011):</h3>
<ul><li>Moved the &#39;Dummy&#39; class under the GenerateMvcT4Extensions check</li>
<li>Always include the area token in the route values unless running on MVC 1.x</li></ul>
<h3>2.6.51 (04-12-2011):</h3>
<ul><li>Ignore async completion methods as they can&#39;t really be used in T4MVC, and can cause issues (<a href="http://stackoverflow.com/questions/5419173/t4mvc-asynccontroller">http://stackoverflow.com/questions/5419173/t4mvc-asynccontroller</a>)</li></ul>
<h3>2.6.50 (04-08-2011):</h3>
<ul><li>Added AddTimestampToStaticLink() method to settings file to allow more granular decision (per <a href="http://mvccontrib.codeplex.com/workitem/7129">this post</a>)</li>
<li>Added GenerateMvcT4Extensions settings flag to omit the generation of the System.Web.Mvc.T4Extensions class, which can be useful if it is already defined in a referenced library (see <a href="http://stackoverflow.com/questions/5563163/t4mvc-use-extension-methods-in-control-library/5574227">this post</a>)</li></ul>
<h3>2.6.44 (03-10-2011):</h3>
<ul><li>Added UseNonQualifiedViewNames flag which when set to true causes view names never to be fully qualified. Spark users may need that.</li></ul>
<h3>2.6.43 (02-24-2011):</h3>
<ul><li>Renamed T4MVC.settings.t4 to T4MVC.tt.settings.t4 so it feels more like a &#39;child&#39; file of T4MVC.tt</li></ul>
<h3>2.6.42 (02-01-2011):</h3>
<ul><li>Fix partial view support for MVC</li>
<li>Fix partial view support when name has periods (<a href="http://mvccontrib.codeplex.com/workitem/7113">http://mvccontrib.codeplex.com/workitem/7113</a>)</li></ul>
<h3>2.6.41 (01-17-2011):</h3>
<ul><li>Added AJAX BeginForm overloads</li></ul>
<h3>2.6.40 (01-05-2011):</h3>
<ul><li>Added BeginForm overload that just takes an ActionResult</li>
<li>Fix MapRouteArea to use UseNamespaceFallback when there are no namespaces</li></ul>
<h3>2.6.32 (12-15-2010):</h3>
<ul><li>Fix bug in controller name generation when IncludeAreasToken is true</li></ul>
<h3>2.6.31 (11-15-2010):</h3>
<ul><li>Improve error message when T4MVC generated files are out of date.</li>
<li>Changed some &#39;const bool&#39; settings to &#39;static bool&#39; to avoid unused code warnings.</li>
<li>Disabled regen optimization added in 2.6.14 since it doesn&#39;t catch view changes</li></ul>
<h3>2.6.30 (09-05-2010):</h3>
<ul><li>Changed ExplicitHtmlHelpersForPartials flag to be off by default (and fix a small issue when it&#39;s off)</li>
<li>Handled System.NotImplementedException if project type (e.g. Installer) does not implement CodeModel property</li>
<li>Fixed issue when action method params are all optional (<a href="http://stackoverflow.com/questions/3488610/t4mvc-and-named-parameters">http://stackoverflow.com/questions/3488610/t4mvc-and-named-parameters</a>)</li>
<li>Exclude Area related methods when using MVC 1.0, as that was breaking things</li>
<li>Added logic to special case DisplayTemplates/EditorTemplates folders, since they need short view names passed in</li></ul>
<h3>2.6.21 (07-20-2010):</h3>
<ul><li>Fix to the partial extension feature added in 2.6.20 to deal with conflicts</li></ul>
<h3>2.6.20 (07-19-2010):</h3>
<ul><li>Added extension methods to render partial views (see <a href="http://www.weirdlover.com/2010/05/12/t4mvc-extension-for-mvc-partials/">this post</a>)
<ul><li>e.g. Html.RenderPartial(&quot;Map&quot;, Model.Dinner); --&gt; Html.RenderMap(Model.Dinner);</li>
<li>Can be turned off in settings file via ExplicitHtmlHelpersForPartials flag.</li></ul></li></ul>
<h3>2.6.15 (05-16-2010):</h3>
<ul><li>Added missing MapRoute overloads to support namespaces</li>
<li>Added MapRoute extensions on AreaRegistrationContext to support areas. Had to name them MapRouteArea to avoid clash with existing MapRoute methods :(</li></ul>
<h3>2.6.14 (05-06-2010):</h3>
<ul><li>Added UseLowercaseRoutes flag to lower case the area, controller and action names in routes</li>
<li>Added support for Views folders that don&#39;t match a controller name.</li>
<li>Added optimization to not regenerate files when the controller has not changed since the last generation</li>
<li>Turn AlwaysKeepTemplateDirty to false by default. We now have an <a href="http://blogs.msdn.com/davidebb/archive/2010/03/18/an-even-better-way-to-run-t4mvc-a-vs-addin.aspx">addin</a> which provides a better solution to this</li></ul>
<h3>2.6.13 (03-08-2010):</h3>
<ul><li>Added AddTimestampToStaticLinks flag to T4MVC.settings.t4 to generate static links that change when the file changes.</li>
<li>Added support for [Bind(Prefix = &quot;newParamName&quot;)] attribute so it generates the correct route value</li>
<li>Added an AddRouteValues overload that takes NameValueCollection, e.g.
<ul><li>MVC.Home.About().AddRouteValues(Request.QueryString)</li></ul></li>
<li>Added MapRoute overload that supports contraints</li>
<li>Removed some logic to support VS2010 Beta 2. VS2010 RC or later should now be used.</li></ul>
<h3>2.6.12 (01-15-2010):</h3>
<ul><li>Fixed issue where some special project types (e.g. DB projects) were throwing while enumerating over the list</li>
<li>Changed to use GeneratedCode attribute instead of the less correct CompilerGenerated</li>
<li>Fixed CompilerGenerated/DebuggerNonUserCode attributes so they don&#39;t incorrectly affect the control classes</li>
<li>Change to avoid adding area to route if the app is not using areas</li></ul>
<h3>2.6.11 (01-10-2010):</h3>
<ul><li>Added ExcludedStaticFileExtensions setting to T4MVC.settings.t4 to list extensions for which static links should not be generated.</li>
<li>Support configurable name for IT4MVCActionResult, and it being defined externally (for sharing pourpose)</li>
<li>Added DebuggerNonUserCode attribute to generated classes</li>
<li>Improved error handling when trying to call T4MVC method with real ActionResult (previous threw InvalidCast)</li>
<li>Fix issue when overridden action methods were incorrectly marked as virtual</li></ul>
<h3>2.6.10 (01-04-2010):</h3>
<ul><li>Added support for adding arbitrary route parameters to T4MVC actions. e.g.
<ul><li>MVC.Home.About().AddRouteValue(&quot;fooKey&quot;, bar.Foo.Key)</li>
<li>MVC.Home.About().AddRouteValues(new {fooKey = bar.Foo.Key, barKey = bar.Key})</li></ul></li>
<li>Added shorter to refer to controller actions from with the controller itself. e.g.
<ul><li>return RedirectToAction(MVC.MyController.Actions.About()); BECOMES:</li>
<li>return RedirectToAction(Actions.About());</li></ul></li>
<li>What was previously called Actions was renamed to ActionNames (note, that&#39;s a BREAKING CHANGE if you used Actions before!)</li>
<li>Ignore controller methods that are marked with a NonAction attribute</li>
<li>Renamed IT4MVCActionResult.RouteValues to avoid conflict (this should not break anything, as it&#39;s only used internally)</li></ul>
<h3>2.6.03 (12-10-2009):</h3>
<ul><li>Generate full view paths to allow cross controller references
<ul><li>e.g. MVC.Dinners.Views.DinnerForm is now &quot;~/Views/Dinners/DinnerForm.ascx&quot; instead of just &quot;DinnerForm&quot;</li></ul></li>
<li>Fix compile error when a view name is a language keyword (e.g. string.ascx)</li></ul>
<h3>2.6.02 (12-04-2009)</h3>
<ul><li>Added way to get area name from both Area and Controller objects
<ul><li>e.g. MVC.MyArea.Name and MVC.MyArea.MyController.Area</li></ul></li>
<li>Added support for controllers in the default namespace (i.e. no namespace)</li>
<li>Always include the area in the route data, even when it&#39;s null/empty</li></ul>
<h3>2.6.01 (12-02-2009)</h3>
<ul><li>Fix compile error when a custom ActionResult type has a ctor that takes a value type</li></ul>
<h3>2.6.00 (11-28-2009)</h3>
<ul><li>Added support for MVC 2 Areas</li>
<li>Fixed issue where non-existing RenderAction method gets generated on VS2010 Beta 2</li>
<li>Added check to give proper error when attempting to run T4MVC outside VS (e.g. from TextTransform.exe)</li></ul>
<h3>2.5.02 (11-24-2009)</h3>
<ul><li>Change links in comment to point to new T4MVC home and forum</li>
<li>Fix scenario where a View folder as a name that&#39;s a C# keyword</li></ul>
<h3>2.5.01 (11-20-2009)</h3>
<ul><li>Added support for Html.RenderAction and Html.Action (see http://haacked.com/archive/2009/11/18/aspnetmvc2-render-action.aspx)</li>
<li>Fix null ref exception issue when custom ActionResult type doesn&#39;t have any explicit ctors</li></ul>
<h3>2.5.00 (11-16-2009)</h3>
<ul><li>Incorporated Damien Guard&#39;s multiple output manager to (optionally) split output from T4MVC into separate files to improve source control</li>
<li>Added support for minified javascript files in production</li>
<li>Fixed bug occurring when no action is of type ActionResult</li></ul>
<h3>2.4.04 (10-15-2009)</h3>
<ul><li>Added support for MVC 2 by detecting the version and generating slightly different code</li></ul>
<h3>2.4.03 (10-02-2009)</h3>
<ul><li>Added ProcessVirtualPath method to T4MVC.settings.t4 so user can write custom logic to modify client URL&#39;s</li>
<li>Greatly simplified GetProjectContainingT4File logic by using FindProjectItem().</li>
<li>Renamed generated classes to be CLS compliant</li>
<li>Moved most of the doc and versioning comments from T4MVC.tt into the readme.txt file, as it was getting a bit long.</li></ul>
<h3>2.4.02 (09-02-2009)</h3>
<ul><li>Added a setting in T4MVC.settings.t4 to set the namespace that Links get generated in</li>
<li>Added pragma to prevent compiler from complaining about missing Xml comments</li>
<li>Added &lt;auto-generated /&gt; comment to disable StyleCop in generated file</li>
<li>Fixed issue when using a custom ResultType in a custom namespace. Now fully qualifying result types.</li></ul>
<h3>2.4.01 (07-29-2009):</h3>
<ul><li>Put all the generated code in a T4MVC #region. This is useful to tell tools like ReSharper to ignore it.</li>
<li>Fixed issue where controller methods returning generic types cause template to blow up</li>
<li>Added a setting in T4MVC.settings.t4 to turn off the behavior that always keeps the template dirty</li></ul>
<h3>2.4.00 (07-28-2009):</h3>
<ul><li>Added support for configurable settings in a separate T4MVC.settings.t4 file</li>
<li>Added a parameter-less pseudo-action for every action that doesn&#39;t already have a parameter-less overload</li>
<li>Added support for having T4MVC.tt in a sub folder instead of always at the root of the project</li>
<li>Fixed issue when a base controller doesn&#39;t have a default ctor</li>
<li>Added T4Extensions into System.Web.Mvc namespace to fix ambiguous resolution issue </li>
<li>Misc cleanup</li></ul>
<h3>2.3.01 (07-10-2009):</h3>
<ul><li>Fixed issue with <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName&referringTitle=T4MVC_History">ActionName</a> attribute set to non literal string values (e.g. <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName%28SomeConst%20%2b%20%22Abc%22%29&referringTitle=T4MVC_History">ActionName&#40;SomeConst &#43; &#34;Abc&#34;&#41;</a>)</li>
<li>Fixed duplication issue when partial controller classes have a base type which contains action methods</li>
<li>Skip App_LocalResources when processing views</li>
<li>Cleaned up rendering logic</li></ul>
<h3>2.3.00 (07-07-2009):</h3>
<ul><li>Added support for sub view folders</li>
<li>Added support for <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName&referringTitle=T4MVC_History">ActionName</a> attribute</li>
<li>Improved handling when the controller comes from a different project</li>
<li>Don&#39;t try to process generic controller classes</li></ul>
<h3>2.2.03 (07-06-2009):</h3>
<ul><li>Added support for action methods defined on controller base classes</li>
<li>Improved error handling when not able to change actions to virtual and controllers to partial</li></ul>
<h3>2.2.02 (07-01-2009):</h3>
<ul><li>Fixed break caused by incorrect support for derived ActionResult types in 2.2.01</li>
<li>Fixed issue with duplicate view tokens getting generated when you have both foo.aspx and foo.ascx</li></ul>
<h3>2.2.01 (07-01-2009):</h3>
<ul><li>Added support for action methods that return a type derived from ActionResult (as opposed to exactly an ActionResult)</li>
<li>Fixed issue when controller is using partial classes</li>
<li>Fixed folder handling logic to deal with generated files</li>
<li>Fixed issue with folder names that are C# keyword</li>
<li>Throw NotSupportedException instead of NotImplementedException to avoid being viewed as a TODO</li></ul>
<h3>2.2.00 (06-30-2009):</h3>
<ul><li>Added strongly typed support to MapRoute</li>
<li>Changed constructor generation to avoid confusing IoC containers</li>
<li>Fixed issue with empty Content folder</li>
<li>Fixed issue with abstract controller base classes</li></ul>
<h3>2.1.00 (06-29-2009):</h3>
<ul><li>Added Html.BeginForm overloads that use the strongly typed pattern</li>
<li>Added Url() helpers on static resources to increase flexibility</li>
<li>Changed generated constants (view and action names, static files) to be readonly strings</li>
<li>Fixed null ref exception in Solution Folder logic</li></ul>
<h3>2.0.04 (06-28-2009):</h3>
<ul><li>Fixed issue with files and folders with names starting with a digit</li></ul>
<h3>2.0.03 (06-27-2009):</h3>
<ul><li>Rework code element enumeration logic to work around a VS2010 issue. The template should now work with VS2010 beta 1!</li>
<li>Reduced some redundancy in the generated code</li></ul>
<h3>2.0.02 (06-27-2009):</h3>
<ul><li>Added ActionLink overloads that take object instead of dictionary (from both Html and Ajax)</li></ul>
<h3>2.0.01 (06-26-2009):</h3>
<ul><li>Fixed issue with files and folders with invalid identifier characters (e.g. spaces, &#39;-&#39;, &#39;.&#39;)</li></ul>
<h3>2.0.00 (06-26-2009):</h3>
<ul><li>Added support for refactoring in Action methods</li>
<li>The T4 file automatically runs whenever you build, instead of being done manually</li>
<li>Support for strongly typed links to static resources</li>
<li>Fix: supports controllers that are in sub-folders of the Controllers folder and not directly in there</li>
<li>Fix: works better with nested solution folder </li>
<li>Random other small fixes</li></ul>
<h3>1.0.xx (06-17-2009):</h3>
<ul><li>the original based on <a href="http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx">this post</a></li></ul>
</div><div class="ClearBoth"></div>davidebboFri, 03 May 2013 22:29:53 GMTUpdated Wiki: T4MVC_History 20130503102953PUpdated Wiki: T4MVC_Historyhttps://t4mvc.codeplex.com/wikipage?title=T4MVC_History&version=28<div class="wikidoc"><h1>T4MVC change history</h1>
<h3>3.6.0 (4-26-2013)</h3>
<ul><li>Add support for task based actions. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/kev_bite/T4mvcTaskBasedActions/contribution/4564">https://t4mvc.codeplex.com/SourceControl/network/forks/kev_bite/T4mvcTaskBasedActions/contribution/4564</a></li></ul>
<h3>3.5.4 (4-22-2013)</h3>
<ul><li>Make action results internal to avoid cross project conflicts</li></ul>
<h3>3.5.3 (4-19-2013):</h3>
<ul><li>Add support for portable areas without a standard area folder</li></ul>
<h3>3.5.2 (3-07-2013):</h3>
<ul><li>Add support for inherited controller attributes. <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/4194">http://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/4194</a></li></ul>
<h3>3.5.1 (2-25-2013):</h3>
<ul><li>If static files include a timestamp, previously for minified CSS- and JavaScript-files the timestamp was generated by taking the last change time of the unminified file. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4122">https://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4122</a></li></ul>
<h3>3.5.0 (2-08-2013):</h3>
<ul><li>Sign T4MVCExtensions.dll <a href="http://t4mvc.codeplex.com/discussions/432534">http://t4mvc.codeplex.com/discussions/432534</a></li>
<li>Call T4Extension.TimestampString through delegate for unit testing <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4040">http://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4040</a></li></ul>
<h3>3.4.1 (1-31-2013):</h3>
<ul><li>Make T4MVCHelpers internal to avoid cross project conflicts <a href="http://t4mvc.codeplex.com/workitem/17">http://t4mvc.codeplex.com/workitem/17</a></li></ul>
<h3>3.4.0 (1-23-2013):</h3>
<ul><li>Add optional support for async methods <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/3958">https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/3958</a></li>
<li>Generate partial methods to allow custom &quot;overloading&quot; of the return values.</li></ul>
<h3>3.3.0 (1-16-2013):</h3>
<ul><li> Add support for support for model unbinder providers <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/Augi/T4MVCUnbinderProvider/contribution/3879">https://t4mvc.codeplex.com/SourceControl/network/forks/Augi/T4MVCUnbinderProvider/contribution/3879</a></li>
<li> Fix handling of &quot;completed&quot; methods <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/phw/t4mvc/contribution/3922">https://t4mvc.codeplex.com/SourceControl/network/forks/phw/t4mvc/contribution/3922</a></li></ul>
<h3>3.2.1 (12-27-2012):</h3>
<ul><li> Fix issue with VB projects causing exceptions <a href="http://t4mvc.codeplex.com/workitem/7">http://t4mvc.codeplex.com/workitem/7</a></li></ul>
<h3>3.2.0 (12-11-2012):</h3>
<ul><li> Add option to make parameter names constants <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/WayneBrantley/ParameterNamesToConst/contribution/3762">https://t4mvc.codeplex.com/SourceControl/network/forks/WayneBrantley/ParameterNamesToConst/contribution/3762</a></li></ul>
<h3>3.1.0 (12-09-2012):</h3>
<ul><li>Added JavaScriptReplacableUrl helper <a href="http://t4mvc.codeplex.com/discussions/405911">http://t4mvc.codeplex.com/discussions/405911</a></li></ul>
<h3>3.0.3 (11-30-2012):</h3>
<ul><li>Fix to deal with multiple attributes <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/ArtiomChi/t4mvc/contribution/3723">http://t4mvc.codeplex.com/SourceControl/network/forks/ArtiomChi/t4mvc/contribution/3723</a></li></ul>
<h3>3.0.2 (11-17-2012):</h3>
<ul><li>Add support for generic result types <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/ryanrust/T4MVC/contribution/3653">http://t4mvc.codeplex.com/SourceControl/network/forks/ryanrust/T4MVC/contribution/3653</a></li></ul>
<h3>3.0.1 (11-16-2012):</h3>
<ul><li>Fix T4MVC.tt.settings.xml so it only gets generated when needed <a href="https://t4mvc.codeplex.com/discussions/403390">https://t4mvc.codeplex.com/discussions/403390</a></li></ul>
<h3>3.0.0 (11-14-2012):</h3>
<ul><li>Move all the non-dynamic code to a separate T4MVCExtensions.dll assembly</li>
<li>Change generated code brace style to Allman</li>
<li>Added many new RouteLink/BeginRouteForm/RouteUrl helpers</li></ul>
<h3>2.13.0 (10-24-2012):</h3>
<ul><li>Move settings to T4MVC.tt.settings.xml XML file instead of tt file. See doc for details.</li>
<li>Make simple view names available alongside full names, e.g. MVC.Home.Views.SomeView vs MVC.Home.Views.ViewNames.SomeView</li></ul>
<h3>2.12.0 (10-16-2012):</h3>
<ul><li>Add support for static files in nested folders <a href="http://t4mvc.codeplex.com/workitem/6">http://t4mvc.codeplex.com/workitem/6</a></li>
<li>Add MVC 4 bundle starter classes <a href="https://t4mvc.codeplex.com/discussions/399205">https://t4mvc.codeplex.com/discussions/399205</a></li></ul>
<h3>2.11.2 (10-11-2012):</h3>
<ul><li>Removed optional params in ActionLink to support expression trees <a href="http://t4mvc.codeplex.com/workitem/4">http://t4mvc.codeplex.com/workitem/4</a></li>
<li>Change brace style of generated code to Allman</li></ul>
<h3>2.11.1 (10-10-2012):</h3>
<ul><li>Ignore methods that return generic types <a href="http://mvccontrib.codeplex.com/workitem/7178">http://mvccontrib.codeplex.com/workitem/7178</a></li></ul>
<h3>2.11.0 (10-09-2012):</h3>
<ul><li>Corrects the ActionParameters class for overloaded actions to list all parameters and not just the parameters from the first action found.</li></ul>
<h3>2.10.4 (10-05-2012):</h3>
<ul><li>Added attributes so it builds clean under Code Analysis <a href="http://t4mvc.codeplex.com/workitem/10">http://t4mvc.codeplex.com/workitem/10</a></li></ul>
<h3>2.10.3 (09-30-2012):</h3>
<ul><li>Fix crash when querystring contains a null key <a href="http://t4mvc.codeplex.com/discussions/396916">http://t4mvc.codeplex.com/discussions/396916</a></li></ul>
<h3>2.10.2 (09-17-2012):</h3>
<ul><li>Fix UnbindModel to avoid failing on duplicate entries <a href="http://t4mvc.codeplex.com/discussions/394529">http://t4mvc.codeplex.com/discussions/394529</a></li>
<li>Fix ModelUnbinder code generation when SplitIntoMultipleFiles is false <a href="http://t4mvc.codeplex.com/workitem/9">http://t4mvc.codeplex.com/workitem/9</a></li></ul>
<h3>2.10.1 (07-31-2012):</h3>
<ul><li>Fixed default param regression with model unbinder code (<a href="http://stackoverflow.com/questions/11566207/t4mvc-optionalparameter-values-implied-from-current-context/11603897">http://stackoverflow.com/questions/11566207/t4mvc-optionalparameter-values-implied-from-current-context/11603897</a>)</li></ul>
<h3>2.10.0 (07-03-2012):</h3>
<ul><li>Added support for custom model binders (<a href="https://t4mvc.codeplex.com/discussions/357386">https://t4mvc.codeplex.com/discussions/357386</a>)</li>
<li>Fixed unreachable code warning</li></ul>
<h3>2.9.0 (06-22-2012):</h3>
<ul><li>Added support for minified css files (<a href="https://t4mvc.codeplex.com/discussions/360443">https://t4mvc.codeplex.com/discussions/360443</a>)</li>
<li>Replaced improper new RouteValueDictionary usage on htmlAttributes</li></ul>
<h3>2.8.1 (04-12-2012):</h3>
<ul><li>Also default to https for the default (no param) action overload</li>
<li>Make T4MVCHelpers class public so that test code in a different assembly can access it</li></ul>
<h3>2.8 (03-25-2012):</h3>
<ul><li>Generate parameter constants for action methods. e.g. MVC.MyController.MethodParams.someParam</li>
<li>Default to https for Action Methods marked as RequireHttps (either at controller or action level)</li></ul>
<h3>2.7.0 (03-09-2012):</h3>
<ul><li>Removed support for MVC earlier than 3, and for CLR earlier than 4.0</li>
<li>Fix ActionLink to work with MVC4 (<a href="http://mvccontrib.codeplex.com/workitem/7191">http://mvccontrib.codeplex.com/workitem/7191</a>)</li></ul>
<h3>2.6.68 (02-03-2012):</h3>
<ul><li>Ignore static ctors when looking for ctors (<a href="http://mvccontrib.codeplex.com/workitem/7185">http://mvccontrib.codeplex.com/workitem/7185</a>)</li></ul>
<h3>2.6.67 (12-24-2011):</h3>
<ul><li>Restore Actions token that wasn&#39;t obsolete after all. Oops. (<a href="http://stackoverflow.com/questions/8625462/t4mvc-actions-token">http://stackoverflow.com/questions/8625462/t4mvc-actions-token</a>)</li></ul>
<h3>2.6.66 (12-22-2011):</h3>
<ul><li>Disable constant generation in UseLowercaseRoutes mode (<a href="http://stackoverflow.com/questions/8605868/t4mvc-2-6-65-and-uselowercaseroutes-true-error">http://stackoverflow.com/questions/8605868/t4mvc-2-6-65-and-uselowercaseroutes-true-error</a>)</li>
<li>Remove obsolete Actions token (<a href="http://stackoverflow.com/questions/8536269/what-is-the-difference-between-these-2-definitions-in-t4mvc/8543510">http://stackoverflow.com/questions/8536269/what-is-the-difference-between-these-2-definitions-in-t4mvc/8543510</a>)</li></ul>
<h3>2.6.65 (12-06-2011):</h3>
<ul><li>Add true constant strings for use in attributes (<a href="http://mvccontrib.codeplex.com/workitem/7177">http://mvccontrib.codeplex.com/workitem/7177</a>)</li></ul>
<h3>2.6.64 (10-21-2011):</h3>
<ul><li>Fix issue when action parameter name is escaped using @ syntax (e.g. int @event)</li></ul>
<h3>2.6.63 (10-13-2011):</h3>
<ul><li>Move hard coded T4MVC namespace into settings file</li></ul>
<h3>2.6.62 (08-13-2011):</h3>
<ul><li>Replace some unwanted tab characters with whitespace</li></ul>
<h3>2.6.61 (08-01-2011):</h3>
<ul><li>Ignore generic action methods (<a href="http://mvccontrib.codeplex.com/workitem/7156">http://mvccontrib.codeplex.com/workitem/7156</a>)</li></ul>
<h3>2.6.60 (07-28-2011):</h3>
<ul><li>Added support for portable areas. Enabled by adding area names to PortableAreas in T4MVC.tt.settings.t4</li>
<li>When generating links and views, if the folder name is the same as the parent, add a modifier to avoid class name conflicts (<a href="http://mvccontrib.codeplex.com/workitem/7153">http://mvccontrib.codeplex.com/workitem/7153</a>)</li></ul>
<h3>2.6.59 (07-12-2011):</h3>
<ul><li>Added commented out logic to show how to debug into the template (<a href="http://mvccontrib.codeplex.com/workitem/7144">http://mvccontrib.codeplex.com/workitem/7144</a>)</li>
<li>Ignore any class which name doesn&#39;t end with &quot;Controller&quot;</li></ul>
<h3>2.6.58 (06-24-2011):</h3>
<ul><li>Change the controller detection logic to be more reliable and ignore anything that doesn&#39;t extend Controller.</li></ul>
<h3>2.6.57 (06-21-2011):</h3>
<ul><li>Re-added Html.ActionLink/Url.Action overload without default params to avoid running into &quot;CS0854: An expression tree may not contain a call or invocation that uses optional arguments&quot;</li>
<li>Make ProcessControllerActionMethods look for ControllerBase instead of Controller to support controllers like MailerBase (from ActionMailer) which extend ControllerBase.</li></ul>
<h3>2.6.56 (06-05-2011):</h3>
<ul><li>Added optional Html.ActionLink parameters for protocol, hostname and fragment (<a href="http://stackoverflow.com/questions/6280347/how-can-i-add-a-hash-fragment-to-t4mvc-route-dictionary-actionresult/6302703">http://stackoverflow.com/questions/6280347/how-can-i-add-a-hash-fragment-to-t4mvc-route-dictionary-actionresult/6302703</a>)</li></ul>
<h3>2.6.55 (06-05-2011):</h3>
<ul><li>Added optional Url.Action parameters for protocol and hostname (<a href="http://stackoverflow.com/questions/6240568/t4mvc-doesnt-work-property-with-url-action">http://stackoverflow.com/questions/6240568/t4mvc-doesnt-work-property-with-url-action</a>)</li></ul>
<h3>2.6.54 (04-23-2011):</h3>
<ul><li>Added missing license to NuGet package and fixed some links. No actual template changes!</li></ul>
<h3>2.6.53 (04-18-2011):</h3>
<ul><li>Ignore actions marked as obsolete (<a href="http://mvccontrib.codeplex.com/workitem/7133">http://mvccontrib.codeplex.com/workitem/7133</a>)</li></ul>
<h3>2.6.52 (04-14-2011):</h3>
<ul><li>Moved the &#39;Dummy&#39; class under the GenerateMvcT4Extensions check</li>
<li>Always include the area token in the route values unless running on MVC 1.x</li></ul>
<h3>2.6.51 (04-12-2011):</h3>
<ul><li>Ignore async completion methods as they can&#39;t really be used in T4MVC, and can cause issues (<a href="http://stackoverflow.com/questions/5419173/t4mvc-asynccontroller">http://stackoverflow.com/questions/5419173/t4mvc-asynccontroller</a>)</li></ul>
<h3>2.6.50 (04-08-2011):</h3>
<ul><li>Added AddTimestampToStaticLink() method to settings file to allow more granular decision (per <a href="http://mvccontrib.codeplex.com/workitem/7129">this post</a>)</li>
<li>Added GenerateMvcT4Extensions settings flag to omit the generation of the System.Web.Mvc.T4Extensions class, which can be useful if it is already defined in a referenced library (see <a href="http://stackoverflow.com/questions/5563163/t4mvc-use-extension-methods-in-control-library/5574227">this post</a>)</li></ul>
<h3>2.6.44 (03-10-2011):</h3>
<ul><li>Added UseNonQualifiedViewNames flag which when set to true causes view names never to be fully qualified. Spark users may need that.</li></ul>
<h3>2.6.43 (02-24-2011):</h3>
<ul><li>Renamed T4MVC.settings.t4 to T4MVC.tt.settings.t4 so it feels more like a &#39;child&#39; file of T4MVC.tt</li></ul>
<h3>2.6.42 (02-01-2011):</h3>
<ul><li>Fix partial view support for MVC</li>
<li>Fix partial view support when name has periods (<a href="http://mvccontrib.codeplex.com/workitem/7113">http://mvccontrib.codeplex.com/workitem/7113</a>)</li></ul>
<h3>2.6.41 (01-17-2011):</h3>
<ul><li>Added AJAX BeginForm overloads</li></ul>
<h3>2.6.40 (01-05-2011):</h3>
<ul><li>Added BeginForm overload that just takes an ActionResult</li>
<li>Fix MapRouteArea to use UseNamespaceFallback when there are no namespaces</li></ul>
<h3>2.6.32 (12-15-2010):</h3>
<ul><li>Fix bug in controller name generation when IncludeAreasToken is true</li></ul>
<h3>2.6.31 (11-15-2010):</h3>
<ul><li>Improve error message when T4MVC generated files are out of date.</li>
<li>Changed some &#39;const bool&#39; settings to &#39;static bool&#39; to avoid unused code warnings.</li>
<li>Disabled regen optimization added in 2.6.14 since it doesn&#39;t catch view changes</li></ul>
<h3>2.6.30 (09-05-2010):</h3>
<ul><li>Changed ExplicitHtmlHelpersForPartials flag to be off by default (and fix a small issue when it&#39;s off)</li>
<li>Handled System.NotImplementedException if project type (e.g. Installer) does not implement CodeModel property</li>
<li>Fixed issue when action method params are all optional (<a href="http://stackoverflow.com/questions/3488610/t4mvc-and-named-parameters">http://stackoverflow.com/questions/3488610/t4mvc-and-named-parameters</a>)</li>
<li>Exclude Area related methods when using MVC 1.0, as that was breaking things</li>
<li>Added logic to special case DisplayTemplates/EditorTemplates folders, since they need short view names passed in</li></ul>
<h3>2.6.21 (07-20-2010):</h3>
<ul><li>Fix to the partial extension feature added in 2.6.20 to deal with conflicts</li></ul>
<h3>2.6.20 (07-19-2010):</h3>
<ul><li>Added extension methods to render partial views (see <a href="http://www.weirdlover.com/2010/05/12/t4mvc-extension-for-mvc-partials/">this post</a>)
<ul><li>e.g. Html.RenderPartial(&quot;Map&quot;, Model.Dinner); --&gt; Html.RenderMap(Model.Dinner);</li>
<li>Can be turned off in settings file via ExplicitHtmlHelpersForPartials flag.</li></ul></li></ul>
<h3>2.6.15 (05-16-2010):</h3>
<ul><li>Added missing MapRoute overloads to support namespaces</li>
<li>Added MapRoute extensions on AreaRegistrationContext to support areas. Had to name them MapRouteArea to avoid clash with existing MapRoute methods :(</li></ul>
<h3>2.6.14 (05-06-2010):</h3>
<ul><li>Added UseLowercaseRoutes flag to lower case the area, controller and action names in routes</li>
<li>Added support for Views folders that don&#39;t match a controller name.</li>
<li>Added optimization to not regenerate files when the controller has not changed since the last generation</li>
<li>Turn AlwaysKeepTemplateDirty to false by default. We now have an <a href="http://blogs.msdn.com/davidebb/archive/2010/03/18/an-even-better-way-to-run-t4mvc-a-vs-addin.aspx">addin</a> which provides a better solution to this</li></ul>
<h3>2.6.13 (03-08-2010):</h3>
<ul><li>Added AddTimestampToStaticLinks flag to T4MVC.settings.t4 to generate static links that change when the file changes.</li>
<li>Added support for [Bind(Prefix = &quot;newParamName&quot;)] attribute so it generates the correct route value</li>
<li>Added an AddRouteValues overload that takes NameValueCollection, e.g.
<ul><li>MVC.Home.About().AddRouteValues(Request.QueryString)</li></ul></li>
<li>Added MapRoute overload that supports contraints</li>
<li>Removed some logic to support VS2010 Beta 2. VS2010 RC or later should now be used.</li></ul>
<h3>2.6.12 (01-15-2010):</h3>
<ul><li>Fixed issue where some special project types (e.g. DB projects) were throwing while enumerating over the list</li>
<li>Changed to use GeneratedCode attribute instead of the less correct CompilerGenerated</li>
<li>Fixed CompilerGenerated/DebuggerNonUserCode attributes so they don&#39;t incorrectly affect the control classes</li>
<li>Change to avoid adding area to route if the app is not using areas</li></ul>
<h3>2.6.11 (01-10-2010):</h3>
<ul><li>Added ExcludedStaticFileExtensions setting to T4MVC.settings.t4 to list extensions for which static links should not be generated.</li>
<li>Support configurable name for IT4MVCActionResult, and it being defined externally (for sharing pourpose)</li>
<li>Added DebuggerNonUserCode attribute to generated classes</li>
<li>Improved error handling when trying to call T4MVC method with real ActionResult (previous threw InvalidCast)</li>
<li>Fix issue when overridden action methods were incorrectly marked as virtual</li></ul>
<h3>2.6.10 (01-04-2010):</h3>
<ul><li>Added support for adding arbitrary route parameters to T4MVC actions. e.g.
<ul><li>MVC.Home.About().AddRouteValue(&quot;fooKey&quot;, bar.Foo.Key)</li>
<li>MVC.Home.About().AddRouteValues(new {fooKey = bar.Foo.Key, barKey = bar.Key})</li></ul></li>
<li>Added shorter to refer to controller actions from with the controller itself. e.g.
<ul><li>return RedirectToAction(MVC.MyController.Actions.About()); BECOMES:</li>
<li>return RedirectToAction(Actions.About());</li></ul></li>
<li>What was previously called Actions was renamed to ActionNames (note, that&#39;s a BREAKING CHANGE if you used Actions before!)</li>
<li>Ignore controller methods that are marked with a NonAction attribute</li>
<li>Renamed IT4MVCActionResult.RouteValues to avoid conflict (this should not break anything, as it&#39;s only used internally)</li></ul>
<h3>2.6.03 (12-10-2009):</h3>
<ul><li>Generate full view paths to allow cross controller references
<ul><li>e.g. MVC.Dinners.Views.DinnerForm is now &quot;~/Views/Dinners/DinnerForm.ascx&quot; instead of just &quot;DinnerForm&quot;</li></ul></li>
<li>Fix compile error when a view name is a language keyword (e.g. string.ascx)</li></ul>
<h3>2.6.02 (12-04-2009)</h3>
<ul><li>Added way to get area name from both Area and Controller objects
<ul><li>e.g. MVC.MyArea.Name and MVC.MyArea.MyController.Area</li></ul></li>
<li>Added support for controllers in the default namespace (i.e. no namespace)</li>
<li>Always include the area in the route data, even when it&#39;s null/empty</li></ul>
<h3>2.6.01 (12-02-2009)</h3>
<ul><li>Fix compile error when a custom ActionResult type has a ctor that takes a value type</li></ul>
<h3>2.6.00 (11-28-2009)</h3>
<ul><li>Added support for MVC 2 Areas</li>
<li>Fixed issue where non-existing RenderAction method gets generated on VS2010 Beta 2</li>
<li>Added check to give proper error when attempting to run T4MVC outside VS (e.g. from TextTransform.exe)</li></ul>
<h3>2.5.02 (11-24-2009)</h3>
<ul><li>Change links in comment to point to new T4MVC home and forum</li>
<li>Fix scenario where a View folder as a name that&#39;s a C# keyword</li></ul>
<h3>2.5.01 (11-20-2009)</h3>
<ul><li>Added support for Html.RenderAction and Html.Action (see http://haacked.com/archive/2009/11/18/aspnetmvc2-render-action.aspx)</li>
<li>Fix null ref exception issue when custom ActionResult type doesn&#39;t have any explicit ctors</li></ul>
<h3>2.5.00 (11-16-2009)</h3>
<ul><li>Incorporated Damien Guard&#39;s multiple output manager to (optionally) split output from T4MVC into separate files to improve source control</li>
<li>Added support for minified javascript files in production</li>
<li>Fixed bug occurring when no action is of type ActionResult</li></ul>
<h3>2.4.04 (10-15-2009)</h3>
<ul><li>Added support for MVC 2 by detecting the version and generating slightly different code</li></ul>
<h3>2.4.03 (10-02-2009)</h3>
<ul><li>Added ProcessVirtualPath method to T4MVC.settings.t4 so user can write custom logic to modify client URL&#39;s</li>
<li>Greatly simplified GetProjectContainingT4File logic by using FindProjectItem().</li>
<li>Renamed generated classes to be CLS compliant</li>
<li>Moved most of the doc and versioning comments from T4MVC.tt into the readme.txt file, as it was getting a bit long.</li></ul>
<h3>2.4.02 (09-02-2009)</h3>
<ul><li>Added a setting in T4MVC.settings.t4 to set the namespace that Links get generated in</li>
<li>Added pragma to prevent compiler from complaining about missing Xml comments</li>
<li>Added &lt;auto-generated /&gt; comment to disable StyleCop in generated file</li>
<li>Fixed issue when using a custom ResultType in a custom namespace. Now fully qualifying result types.</li></ul>
<h3>2.4.01 (07-29-2009):</h3>
<ul><li>Put all the generated code in a T4MVC #region. This is useful to tell tools like ReSharper to ignore it.</li>
<li>Fixed issue where controller methods returning generic types cause template to blow up</li>
<li>Added a setting in T4MVC.settings.t4 to turn off the behavior that always keeps the template dirty</li></ul>
<h3>2.4.00 (07-28-2009):</h3>
<ul><li>Added support for configurable settings in a separate T4MVC.settings.t4 file</li>
<li>Added a parameter-less pseudo-action for every action that doesn&#39;t already have a parameter-less overload</li>
<li>Added support for having T4MVC.tt in a sub folder instead of always at the root of the project</li>
<li>Fixed issue when a base controller doesn&#39;t have a default ctor</li>
<li>Added T4Extensions into System.Web.Mvc namespace to fix ambiguous resolution issue </li>
<li>Misc cleanup</li></ul>
<h3>2.3.01 (07-10-2009):</h3>
<ul><li>Fixed issue with <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName&referringTitle=T4MVC_History">ActionName</a> attribute set to non literal string values (e.g. <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName%28SomeConst%20%2b%20%22Abc%22%29&referringTitle=T4MVC_History">ActionName&#40;SomeConst &#43; &#34;Abc&#34;&#41;</a>)</li>
<li>Fixed duplication issue when partial controller classes have a base type which contains action methods</li>
<li>Skip App_LocalResources when processing views</li>
<li>Cleaned up rendering logic</li></ul>
<h3>2.3.00 (07-07-2009):</h3>
<ul><li>Added support for sub view folders</li>
<li>Added support for <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName&referringTitle=T4MVC_History">ActionName</a> attribute</li>
<li>Improved handling when the controller comes from a different project</li>
<li>Don&#39;t try to process generic controller classes</li></ul>
<h3>2.2.03 (07-06-2009):</h3>
<ul><li>Added support for action methods defined on controller base classes</li>
<li>Improved error handling when not able to change actions to virtual and controllers to partial</li></ul>
<h3>2.2.02 (07-01-2009):</h3>
<ul><li>Fixed break caused by incorrect support for derived ActionResult types in 2.2.01</li>
<li>Fixed issue with duplicate view tokens getting generated when you have both foo.aspx and foo.ascx</li></ul>
<h3>2.2.01 (07-01-2009):</h3>
<ul><li>Added support for action methods that return a type derived from ActionResult (as opposed to exactly an ActionResult)</li>
<li>Fixed issue when controller is using partial classes</li>
<li>Fixed folder handling logic to deal with generated files</li>
<li>Fixed issue with folder names that are C# keyword</li>
<li>Throw NotSupportedException instead of NotImplementedException to avoid being viewed as a TODO</li></ul>
<h3>2.2.00 (06-30-2009):</h3>
<ul><li>Added strongly typed support to MapRoute</li>
<li>Changed constructor generation to avoid confusing IoC containers</li>
<li>Fixed issue with empty Content folder</li>
<li>Fixed issue with abstract controller base classes</li></ul>
<h3>2.1.00 (06-29-2009):</h3>
<ul><li>Added Html.BeginForm overloads that use the strongly typed pattern</li>
<li>Added Url() helpers on static resources to increase flexibility</li>
<li>Changed generated constants (view and action names, static files) to be readonly strings</li>
<li>Fixed null ref exception in Solution Folder logic</li></ul>
<h3>2.0.04 (06-28-2009):</h3>
<ul><li>Fixed issue with files and folders with names starting with a digit</li></ul>
<h3>2.0.03 (06-27-2009):</h3>
<ul><li>Rework code element enumeration logic to work around a VS2010 issue. The template should now work with VS2010 beta 1!</li>
<li>Reduced some redundancy in the generated code</li></ul>
<h3>2.0.02 (06-27-2009):</h3>
<ul><li>Added ActionLink overloads that take object instead of dictionary (from both Html and Ajax)</li></ul>
<h3>2.0.01 (06-26-2009):</h3>
<ul><li>Fixed issue with files and folders with invalid identifier characters (e.g. spaces, &#39;-&#39;, &#39;.&#39;)</li></ul>
<h3>2.0.00 (06-26-2009):</h3>
<ul><li>Added support for refactoring in Action methods</li>
<li>The T4 file automatically runs whenever you build, instead of being done manually</li>
<li>Support for strongly typed links to static resources</li>
<li>Fix: supports controllers that are in sub-folders of the Controllers folder and not directly in there</li>
<li>Fix: works better with nested solution folder </li>
<li>Random other small fixes</li></ul>
<h3>1.0.xx (06-17-2009):</h3>
<ul><li>the original based on <a href="http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx">this post</a></li></ul>
</div><div class="ClearBoth"></div>davidebboSat, 27 Apr 2013 01:41:32 GMTUpdated Wiki: T4MVC_History 20130427014132AUpdated Wiki: T4MVC_Historyhttps://t4mvc.codeplex.com/wikipage?title=T4MVC_History&version=27<div class="wikidoc"><h1>T4MVC change history</h1>
<h3>3.5.4 (4-22-2013)</h3>
<ul><li>Make action results internal to avoid cross project conflicts</li></ul>
<h3>3.5.3 (4-19-2013):</h3>
<ul><li>Add support for portable areas without a standard area folder</li></ul>
<h3>3.5.2 (3-07-2013):</h3>
<ul><li>Add support for inherited controller attributes. <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/4194">http://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/4194</a></li></ul>
<h3>3.5.1 (2-25-2013):</h3>
<ul><li>If static files include a timestamp, previously for minified CSS- and JavaScript-files the timestamp was generated by taking the last change time of the unminified file. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4122">https://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4122</a></li></ul>
<h3>3.5.0 (2-08-2013):</h3>
<ul><li>Sign T4MVCExtensions.dll <a href="http://t4mvc.codeplex.com/discussions/432534">http://t4mvc.codeplex.com/discussions/432534</a></li>
<li>Call T4Extension.TimestampString through delegate for unit testing <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4040">http://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4040</a></li></ul>
<h3>3.4.1 (1-31-2013):</h3>
<ul><li>Make T4MVCHelpers internal to avoid cross project conflicts <a href="http://t4mvc.codeplex.com/workitem/17">http://t4mvc.codeplex.com/workitem/17</a></li></ul>
<h3>3.4.0 (1-23-2013):</h3>
<ul><li>Add optional support for async methods <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/3958">https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/3958</a></li>
<li>Generate partial methods to allow custom &quot;overloading&quot; of the return values.</li></ul>
<h3>3.3.0 (1-16-2013):</h3>
<ul><li> Add support for support for model unbinder providers <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/Augi/T4MVCUnbinderProvider/contribution/3879">https://t4mvc.codeplex.com/SourceControl/network/forks/Augi/T4MVCUnbinderProvider/contribution/3879</a></li>
<li> Fix handling of &quot;completed&quot; methods <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/phw/t4mvc/contribution/3922">https://t4mvc.codeplex.com/SourceControl/network/forks/phw/t4mvc/contribution/3922</a></li></ul>
<h3>3.2.1 (12-27-2012):</h3>
<ul><li> Fix issue with VB projects causing exceptions <a href="http://t4mvc.codeplex.com/workitem/7">http://t4mvc.codeplex.com/workitem/7</a></li></ul>
<h3>3.2.0 (12-11-2012):</h3>
<ul><li> Add option to make parameter names constants <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/WayneBrantley/ParameterNamesToConst/contribution/3762">https://t4mvc.codeplex.com/SourceControl/network/forks/WayneBrantley/ParameterNamesToConst/contribution/3762</a></li></ul>
<h3>3.1.0 (12-09-2012):</h3>
<ul><li>Added JavaScriptReplacableUrl helper <a href="http://t4mvc.codeplex.com/discussions/405911">http://t4mvc.codeplex.com/discussions/405911</a></li></ul>
<h3>3.0.3 (11-30-2012):</h3>
<ul><li>Fix to deal with multiple attributes <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/ArtiomChi/t4mvc/contribution/3723">http://t4mvc.codeplex.com/SourceControl/network/forks/ArtiomChi/t4mvc/contribution/3723</a></li></ul>
<h3>3.0.2 (11-17-2012):</h3>
<ul><li>Add support for generic result types <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/ryanrust/T4MVC/contribution/3653">http://t4mvc.codeplex.com/SourceControl/network/forks/ryanrust/T4MVC/contribution/3653</a></li></ul>
<h3>3.0.1 (11-16-2012):</h3>
<ul><li>Fix T4MVC.tt.settings.xml so it only gets generated when needed <a href="https://t4mvc.codeplex.com/discussions/403390">https://t4mvc.codeplex.com/discussions/403390</a></li></ul>
<h3>3.0.0 (11-14-2012):</h3>
<ul><li>Move all the non-dynamic code to a separate T4MVCExtensions.dll assembly</li>
<li>Change generated code brace style to Allman</li>
<li>Added many new RouteLink/BeginRouteForm/RouteUrl helpers</li></ul>
<h3>2.13.0 (10-24-2012):</h3>
<ul><li>Move settings to T4MVC.tt.settings.xml XML file instead of tt file. See doc for details.</li>
<li>Make simple view names available alongside full names, e.g. MVC.Home.Views.SomeView vs MVC.Home.Views.ViewNames.SomeView</li></ul>
<h3>2.12.0 (10-16-2012):</h3>
<ul><li>Add support for static files in nested folders <a href="http://t4mvc.codeplex.com/workitem/6">http://t4mvc.codeplex.com/workitem/6</a></li>
<li>Add MVC 4 bundle starter classes <a href="https://t4mvc.codeplex.com/discussions/399205">https://t4mvc.codeplex.com/discussions/399205</a></li></ul>
<h3>2.11.2 (10-11-2012):</h3>
<ul><li>Removed optional params in ActionLink to support expression trees <a href="http://t4mvc.codeplex.com/workitem/4">http://t4mvc.codeplex.com/workitem/4</a></li>
<li>Change brace style of generated code to Allman</li></ul>
<h3>2.11.1 (10-10-2012):</h3>
<ul><li>Ignore methods that return generic types <a href="http://mvccontrib.codeplex.com/workitem/7178">http://mvccontrib.codeplex.com/workitem/7178</a></li></ul>
<h3>2.11.0 (10-09-2012):</h3>
<ul><li>Corrects the ActionParameters class for overloaded actions to list all parameters and not just the parameters from the first action found.</li></ul>
<h3>2.10.4 (10-05-2012):</h3>
<ul><li>Added attributes so it builds clean under Code Analysis <a href="http://t4mvc.codeplex.com/workitem/10">http://t4mvc.codeplex.com/workitem/10</a></li></ul>
<h3>2.10.3 (09-30-2012):</h3>
<ul><li>Fix crash when querystring contains a null key <a href="http://t4mvc.codeplex.com/discussions/396916">http://t4mvc.codeplex.com/discussions/396916</a></li></ul>
<h3>2.10.2 (09-17-2012):</h3>
<ul><li>Fix UnbindModel to avoid failing on duplicate entries <a href="http://t4mvc.codeplex.com/discussions/394529">http://t4mvc.codeplex.com/discussions/394529</a></li>
<li>Fix ModelUnbinder code generation when SplitIntoMultipleFiles is false <a href="http://t4mvc.codeplex.com/workitem/9">http://t4mvc.codeplex.com/workitem/9</a></li></ul>
<h3>2.10.1 (07-31-2012):</h3>
<ul><li>Fixed default param regression with model unbinder code (<a href="http://stackoverflow.com/questions/11566207/t4mvc-optionalparameter-values-implied-from-current-context/11603897">http://stackoverflow.com/questions/11566207/t4mvc-optionalparameter-values-implied-from-current-context/11603897</a>)</li></ul>
<h3>2.10.0 (07-03-2012):</h3>
<ul><li>Added support for custom model binders (<a href="https://t4mvc.codeplex.com/discussions/357386">https://t4mvc.codeplex.com/discussions/357386</a>)</li>
<li>Fixed unreachable code warning</li></ul>
<h3>2.9.0 (06-22-2012):</h3>
<ul><li>Added support for minified css files (<a href="https://t4mvc.codeplex.com/discussions/360443">https://t4mvc.codeplex.com/discussions/360443</a>)</li>
<li>Replaced improper new RouteValueDictionary usage on htmlAttributes</li></ul>
<h3>2.8.1 (04-12-2012):</h3>
<ul><li>Also default to https for the default (no param) action overload</li>
<li>Make T4MVCHelpers class public so that test code in a different assembly can access it</li></ul>
<h3>2.8 (03-25-2012):</h3>
<ul><li>Generate parameter constants for action methods. e.g. MVC.MyController.MethodParams.someParam</li>
<li>Default to https for Action Methods marked as RequireHttps (either at controller or action level)</li></ul>
<h3>2.7.0 (03-09-2012):</h3>
<ul><li>Removed support for MVC earlier than 3, and for CLR earlier than 4.0</li>
<li>Fix ActionLink to work with MVC4 (<a href="http://mvccontrib.codeplex.com/workitem/7191">http://mvccontrib.codeplex.com/workitem/7191</a>)</li></ul>
<h3>2.6.68 (02-03-2012):</h3>
<ul><li>Ignore static ctors when looking for ctors (<a href="http://mvccontrib.codeplex.com/workitem/7185">http://mvccontrib.codeplex.com/workitem/7185</a>)</li></ul>
<h3>2.6.67 (12-24-2011):</h3>
<ul><li>Restore Actions token that wasn&#39;t obsolete after all. Oops. (<a href="http://stackoverflow.com/questions/8625462/t4mvc-actions-token">http://stackoverflow.com/questions/8625462/t4mvc-actions-token</a>)</li></ul>
<h3>2.6.66 (12-22-2011):</h3>
<ul><li>Disable constant generation in UseLowercaseRoutes mode (<a href="http://stackoverflow.com/questions/8605868/t4mvc-2-6-65-and-uselowercaseroutes-true-error">http://stackoverflow.com/questions/8605868/t4mvc-2-6-65-and-uselowercaseroutes-true-error</a>)</li>
<li>Remove obsolete Actions token (<a href="http://stackoverflow.com/questions/8536269/what-is-the-difference-between-these-2-definitions-in-t4mvc/8543510">http://stackoverflow.com/questions/8536269/what-is-the-difference-between-these-2-definitions-in-t4mvc/8543510</a>)</li></ul>
<h3>2.6.65 (12-06-2011):</h3>
<ul><li>Add true constant strings for use in attributes (<a href="http://mvccontrib.codeplex.com/workitem/7177">http://mvccontrib.codeplex.com/workitem/7177</a>)</li></ul>
<h3>2.6.64 (10-21-2011):</h3>
<ul><li>Fix issue when action parameter name is escaped using @ syntax (e.g. int @event)</li></ul>
<h3>2.6.63 (10-13-2011):</h3>
<ul><li>Move hard coded T4MVC namespace into settings file</li></ul>
<h3>2.6.62 (08-13-2011):</h3>
<ul><li>Replace some unwanted tab characters with whitespace</li></ul>
<h3>2.6.61 (08-01-2011):</h3>
<ul><li>Ignore generic action methods (<a href="http://mvccontrib.codeplex.com/workitem/7156">http://mvccontrib.codeplex.com/workitem/7156</a>)</li></ul>
<h3>2.6.60 (07-28-2011):</h3>
<ul><li>Added support for portable areas. Enabled by adding area names to PortableAreas in T4MVC.tt.settings.t4</li>
<li>When generating links and views, if the folder name is the same as the parent, add a modifier to avoid class name conflicts (<a href="http://mvccontrib.codeplex.com/workitem/7153">http://mvccontrib.codeplex.com/workitem/7153</a>)</li></ul>
<h3>2.6.59 (07-12-2011):</h3>
<ul><li>Added commented out logic to show how to debug into the template (<a href="http://mvccontrib.codeplex.com/workitem/7144">http://mvccontrib.codeplex.com/workitem/7144</a>)</li>
<li>Ignore any class which name doesn&#39;t end with &quot;Controller&quot;</li></ul>
<h3>2.6.58 (06-24-2011):</h3>
<ul><li>Change the controller detection logic to be more reliable and ignore anything that doesn&#39;t extend Controller.</li></ul>
<h3>2.6.57 (06-21-2011):</h3>
<ul><li>Re-added Html.ActionLink/Url.Action overload without default params to avoid running into &quot;CS0854: An expression tree may not contain a call or invocation that uses optional arguments&quot;</li>
<li>Make ProcessControllerActionMethods look for ControllerBase instead of Controller to support controllers like MailerBase (from ActionMailer) which extend ControllerBase.</li></ul>
<h3>2.6.56 (06-05-2011):</h3>
<ul><li>Added optional Html.ActionLink parameters for protocol, hostname and fragment (<a href="http://stackoverflow.com/questions/6280347/how-can-i-add-a-hash-fragment-to-t4mvc-route-dictionary-actionresult/6302703">http://stackoverflow.com/questions/6280347/how-can-i-add-a-hash-fragment-to-t4mvc-route-dictionary-actionresult/6302703</a>)</li></ul>
<h3>2.6.55 (06-05-2011):</h3>
<ul><li>Added optional Url.Action parameters for protocol and hostname (<a href="http://stackoverflow.com/questions/6240568/t4mvc-doesnt-work-property-with-url-action">http://stackoverflow.com/questions/6240568/t4mvc-doesnt-work-property-with-url-action</a>)</li></ul>
<h3>2.6.54 (04-23-2011):</h3>
<ul><li>Added missing license to NuGet package and fixed some links. No actual template changes!</li></ul>
<h3>2.6.53 (04-18-2011):</h3>
<ul><li>Ignore actions marked as obsolete (<a href="http://mvccontrib.codeplex.com/workitem/7133">http://mvccontrib.codeplex.com/workitem/7133</a>)</li></ul>
<h3>2.6.52 (04-14-2011):</h3>
<ul><li>Moved the &#39;Dummy&#39; class under the GenerateMvcT4Extensions check</li>
<li>Always include the area token in the route values unless running on MVC 1.x</li></ul>
<h3>2.6.51 (04-12-2011):</h3>
<ul><li>Ignore async completion methods as they can&#39;t really be used in T4MVC, and can cause issues (<a href="http://stackoverflow.com/questions/5419173/t4mvc-asynccontroller">http://stackoverflow.com/questions/5419173/t4mvc-asynccontroller</a>)</li></ul>
<h3>2.6.50 (04-08-2011):</h3>
<ul><li>Added AddTimestampToStaticLink() method to settings file to allow more granular decision (per <a href="http://mvccontrib.codeplex.com/workitem/7129">this post</a>)</li>
<li>Added GenerateMvcT4Extensions settings flag to omit the generation of the System.Web.Mvc.T4Extensions class, which can be useful if it is already defined in a referenced library (see <a href="http://stackoverflow.com/questions/5563163/t4mvc-use-extension-methods-in-control-library/5574227">this post</a>)</li></ul>
<h3>2.6.44 (03-10-2011):</h3>
<ul><li>Added UseNonQualifiedViewNames flag which when set to true causes view names never to be fully qualified. Spark users may need that.</li></ul>
<h3>2.6.43 (02-24-2011):</h3>
<ul><li>Renamed T4MVC.settings.t4 to T4MVC.tt.settings.t4 so it feels more like a &#39;child&#39; file of T4MVC.tt</li></ul>
<h3>2.6.42 (02-01-2011):</h3>
<ul><li>Fix partial view support for MVC</li>
<li>Fix partial view support when name has periods (<a href="http://mvccontrib.codeplex.com/workitem/7113">http://mvccontrib.codeplex.com/workitem/7113</a>)</li></ul>
<h3>2.6.41 (01-17-2011):</h3>
<ul><li>Added AJAX BeginForm overloads</li></ul>
<h3>2.6.40 (01-05-2011):</h3>
<ul><li>Added BeginForm overload that just takes an ActionResult</li>
<li>Fix MapRouteArea to use UseNamespaceFallback when there are no namespaces</li></ul>
<h3>2.6.32 (12-15-2010):</h3>
<ul><li>Fix bug in controller name generation when IncludeAreasToken is true</li></ul>
<h3>2.6.31 (11-15-2010):</h3>
<ul><li>Improve error message when T4MVC generated files are out of date.</li>
<li>Changed some &#39;const bool&#39; settings to &#39;static bool&#39; to avoid unused code warnings.</li>
<li>Disabled regen optimization added in 2.6.14 since it doesn&#39;t catch view changes</li></ul>
<h3>2.6.30 (09-05-2010):</h3>
<ul><li>Changed ExplicitHtmlHelpersForPartials flag to be off by default (and fix a small issue when it&#39;s off)</li>
<li>Handled System.NotImplementedException if project type (e.g. Installer) does not implement CodeModel property</li>
<li>Fixed issue when action method params are all optional (<a href="http://stackoverflow.com/questions/3488610/t4mvc-and-named-parameters">http://stackoverflow.com/questions/3488610/t4mvc-and-named-parameters</a>)</li>
<li>Exclude Area related methods when using MVC 1.0, as that was breaking things</li>
<li>Added logic to special case DisplayTemplates/EditorTemplates folders, since they need short view names passed in</li></ul>
<h3>2.6.21 (07-20-2010):</h3>
<ul><li>Fix to the partial extension feature added in 2.6.20 to deal with conflicts</li></ul>
<h3>2.6.20 (07-19-2010):</h3>
<ul><li>Added extension methods to render partial views (see <a href="http://www.weirdlover.com/2010/05/12/t4mvc-extension-for-mvc-partials/">this post</a>)
<ul><li>e.g. Html.RenderPartial(&quot;Map&quot;, Model.Dinner); --&gt; Html.RenderMap(Model.Dinner);</li>
<li>Can be turned off in settings file via ExplicitHtmlHelpersForPartials flag.</li></ul></li></ul>
<h3>2.6.15 (05-16-2010):</h3>
<ul><li>Added missing MapRoute overloads to support namespaces</li>
<li>Added MapRoute extensions on AreaRegistrationContext to support areas. Had to name them MapRouteArea to avoid clash with existing MapRoute methods :(</li></ul>
<h3>2.6.14 (05-06-2010):</h3>
<ul><li>Added UseLowercaseRoutes flag to lower case the area, controller and action names in routes</li>
<li>Added support for Views folders that don&#39;t match a controller name.</li>
<li>Added optimization to not regenerate files when the controller has not changed since the last generation</li>
<li>Turn AlwaysKeepTemplateDirty to false by default. We now have an <a href="http://blogs.msdn.com/davidebb/archive/2010/03/18/an-even-better-way-to-run-t4mvc-a-vs-addin.aspx">addin</a> which provides a better solution to this</li></ul>
<h3>2.6.13 (03-08-2010):</h3>
<ul><li>Added AddTimestampToStaticLinks flag to T4MVC.settings.t4 to generate static links that change when the file changes.</li>
<li>Added support for [Bind(Prefix = &quot;newParamName&quot;)] attribute so it generates the correct route value</li>
<li>Added an AddRouteValues overload that takes NameValueCollection, e.g.
<ul><li>MVC.Home.About().AddRouteValues(Request.QueryString)</li></ul></li>
<li>Added MapRoute overload that supports contraints</li>
<li>Removed some logic to support VS2010 Beta 2. VS2010 RC or later should now be used.</li></ul>
<h3>2.6.12 (01-15-2010):</h3>
<ul><li>Fixed issue where some special project types (e.g. DB projects) were throwing while enumerating over the list</li>
<li>Changed to use GeneratedCode attribute instead of the less correct CompilerGenerated</li>
<li>Fixed CompilerGenerated/DebuggerNonUserCode attributes so they don&#39;t incorrectly affect the control classes</li>
<li>Change to avoid adding area to route if the app is not using areas</li></ul>
<h3>2.6.11 (01-10-2010):</h3>
<ul><li>Added ExcludedStaticFileExtensions setting to T4MVC.settings.t4 to list extensions for which static links should not be generated.</li>
<li>Support configurable name for IT4MVCActionResult, and it being defined externally (for sharing pourpose)</li>
<li>Added DebuggerNonUserCode attribute to generated classes</li>
<li>Improved error handling when trying to call T4MVC method with real ActionResult (previous threw InvalidCast)</li>
<li>Fix issue when overridden action methods were incorrectly marked as virtual</li></ul>
<h3>2.6.10 (01-04-2010):</h3>
<ul><li>Added support for adding arbitrary route parameters to T4MVC actions. e.g.
<ul><li>MVC.Home.About().AddRouteValue(&quot;fooKey&quot;, bar.Foo.Key)</li>
<li>MVC.Home.About().AddRouteValues(new {fooKey = bar.Foo.Key, barKey = bar.Key})</li></ul></li>
<li>Added shorter to refer to controller actions from with the controller itself. e.g.
<ul><li>return RedirectToAction(MVC.MyController.Actions.About()); BECOMES:</li>
<li>return RedirectToAction(Actions.About());</li></ul></li>
<li>What was previously called Actions was renamed to ActionNames (note, that&#39;s a BREAKING CHANGE if you used Actions before!)</li>
<li>Ignore controller methods that are marked with a NonAction attribute</li>
<li>Renamed IT4MVCActionResult.RouteValues to avoid conflict (this should not break anything, as it&#39;s only used internally)</li></ul>
<h3>2.6.03 (12-10-2009):</h3>
<ul><li>Generate full view paths to allow cross controller references
<ul><li>e.g. MVC.Dinners.Views.DinnerForm is now &quot;~/Views/Dinners/DinnerForm.ascx&quot; instead of just &quot;DinnerForm&quot;</li></ul></li>
<li>Fix compile error when a view name is a language keyword (e.g. string.ascx)</li></ul>
<h3>2.6.02 (12-04-2009)</h3>
<ul><li>Added way to get area name from both Area and Controller objects
<ul><li>e.g. MVC.MyArea.Name and MVC.MyArea.MyController.Area</li></ul></li>
<li>Added support for controllers in the default namespace (i.e. no namespace)</li>
<li>Always include the area in the route data, even when it&#39;s null/empty</li></ul>
<h3>2.6.01 (12-02-2009)</h3>
<ul><li>Fix compile error when a custom ActionResult type has a ctor that takes a value type</li></ul>
<h3>2.6.00 (11-28-2009)</h3>
<ul><li>Added support for MVC 2 Areas</li>
<li>Fixed issue where non-existing RenderAction method gets generated on VS2010 Beta 2</li>
<li>Added check to give proper error when attempting to run T4MVC outside VS (e.g. from TextTransform.exe)</li></ul>
<h3>2.5.02 (11-24-2009)</h3>
<ul><li>Change links in comment to point to new T4MVC home and forum</li>
<li>Fix scenario where a View folder as a name that&#39;s a C# keyword</li></ul>
<h3>2.5.01 (11-20-2009)</h3>
<ul><li>Added support for Html.RenderAction and Html.Action (see http://haacked.com/archive/2009/11/18/aspnetmvc2-render-action.aspx)</li>
<li>Fix null ref exception issue when custom ActionResult type doesn&#39;t have any explicit ctors</li></ul>
<h3>2.5.00 (11-16-2009)</h3>
<ul><li>Incorporated Damien Guard&#39;s multiple output manager to (optionally) split output from T4MVC into separate files to improve source control</li>
<li>Added support for minified javascript files in production</li>
<li>Fixed bug occurring when no action is of type ActionResult</li></ul>
<h3>2.4.04 (10-15-2009)</h3>
<ul><li>Added support for MVC 2 by detecting the version and generating slightly different code</li></ul>
<h3>2.4.03 (10-02-2009)</h3>
<ul><li>Added ProcessVirtualPath method to T4MVC.settings.t4 so user can write custom logic to modify client URL&#39;s</li>
<li>Greatly simplified GetProjectContainingT4File logic by using FindProjectItem().</li>
<li>Renamed generated classes to be CLS compliant</li>
<li>Moved most of the doc and versioning comments from T4MVC.tt into the readme.txt file, as it was getting a bit long.</li></ul>
<h3>2.4.02 (09-02-2009)</h3>
<ul><li>Added a setting in T4MVC.settings.t4 to set the namespace that Links get generated in</li>
<li>Added pragma to prevent compiler from complaining about missing Xml comments</li>
<li>Added &lt;auto-generated /&gt; comment to disable StyleCop in generated file</li>
<li>Fixed issue when using a custom ResultType in a custom namespace. Now fully qualifying result types.</li></ul>
<h3>2.4.01 (07-29-2009):</h3>
<ul><li>Put all the generated code in a T4MVC #region. This is useful to tell tools like ReSharper to ignore it.</li>
<li>Fixed issue where controller methods returning generic types cause template to blow up</li>
<li>Added a setting in T4MVC.settings.t4 to turn off the behavior that always keeps the template dirty</li></ul>
<h3>2.4.00 (07-28-2009):</h3>
<ul><li>Added support for configurable settings in a separate T4MVC.settings.t4 file</li>
<li>Added a parameter-less pseudo-action for every action that doesn&#39;t already have a parameter-less overload</li>
<li>Added support for having T4MVC.tt in a sub folder instead of always at the root of the project</li>
<li>Fixed issue when a base controller doesn&#39;t have a default ctor</li>
<li>Added T4Extensions into System.Web.Mvc namespace to fix ambiguous resolution issue </li>
<li>Misc cleanup</li></ul>
<h3>2.3.01 (07-10-2009):</h3>
<ul><li>Fixed issue with <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName&referringTitle=T4MVC_History">ActionName</a> attribute set to non literal string values (e.g. <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName%28SomeConst%20%2b%20%22Abc%22%29&referringTitle=T4MVC_History">ActionName&#40;SomeConst &#43; &#34;Abc&#34;&#41;</a>)</li>
<li>Fixed duplication issue when partial controller classes have a base type which contains action methods</li>
<li>Skip App_LocalResources when processing views</li>
<li>Cleaned up rendering logic</li></ul>
<h3>2.3.00 (07-07-2009):</h3>
<ul><li>Added support for sub view folders</li>
<li>Added support for <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName&referringTitle=T4MVC_History">ActionName</a> attribute</li>
<li>Improved handling when the controller comes from a different project</li>
<li>Don&#39;t try to process generic controller classes</li></ul>
<h3>2.2.03 (07-06-2009):</h3>
<ul><li>Added support for action methods defined on controller base classes</li>
<li>Improved error handling when not able to change actions to virtual and controllers to partial</li></ul>
<h3>2.2.02 (07-01-2009):</h3>
<ul><li>Fixed break caused by incorrect support for derived ActionResult types in 2.2.01</li>
<li>Fixed issue with duplicate view tokens getting generated when you have both foo.aspx and foo.ascx</li></ul>
<h3>2.2.01 (07-01-2009):</h3>
<ul><li>Added support for action methods that return a type derived from ActionResult (as opposed to exactly an ActionResult)</li>
<li>Fixed issue when controller is using partial classes</li>
<li>Fixed folder handling logic to deal with generated files</li>
<li>Fixed issue with folder names that are C# keyword</li>
<li>Throw NotSupportedException instead of NotImplementedException to avoid being viewed as a TODO</li></ul>
<h3>2.2.00 (06-30-2009):</h3>
<ul><li>Added strongly typed support to MapRoute</li>
<li>Changed constructor generation to avoid confusing IoC containers</li>
<li>Fixed issue with empty Content folder</li>
<li>Fixed issue with abstract controller base classes</li></ul>
<h3>2.1.00 (06-29-2009):</h3>
<ul><li>Added Html.BeginForm overloads that use the strongly typed pattern</li>
<li>Added Url() helpers on static resources to increase flexibility</li>
<li>Changed generated constants (view and action names, static files) to be readonly strings</li>
<li>Fixed null ref exception in Solution Folder logic</li></ul>
<h3>2.0.04 (06-28-2009):</h3>
<ul><li>Fixed issue with files and folders with names starting with a digit</li></ul>
<h3>2.0.03 (06-27-2009):</h3>
<ul><li>Rework code element enumeration logic to work around a VS2010 issue. The template should now work with VS2010 beta 1!</li>
<li>Reduced some redundancy in the generated code</li></ul>
<h3>2.0.02 (06-27-2009):</h3>
<ul><li>Added ActionLink overloads that take object instead of dictionary (from both Html and Ajax)</li></ul>
<h3>2.0.01 (06-26-2009):</h3>
<ul><li>Fixed issue with files and folders with invalid identifier characters (e.g. spaces, &#39;-&#39;, &#39;.&#39;)</li></ul>
<h3>2.0.00 (06-26-2009):</h3>
<ul><li>Added support for refactoring in Action methods</li>
<li>The T4 file automatically runs whenever you build, instead of being done manually</li>
<li>Support for strongly typed links to static resources</li>
<li>Fix: supports controllers that are in sub-folders of the Controllers folder and not directly in there</li>
<li>Fix: works better with nested solution folder </li>
<li>Random other small fixes</li></ul>
<h3>1.0.xx (06-17-2009):</h3>
<ul><li>the original based on <a href="http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx">this post</a></li></ul>
</div><div class="ClearBoth"></div>davidebboMon, 22 Apr 2013 22:13:53 GMTUpdated Wiki: T4MVC_History 20130422101353PUpdated Wiki: T4MVC_Historyhttps://t4mvc.codeplex.com/wikipage?title=T4MVC_History&version=26<div class="wikidoc"><h1>T4MVC change history</h1>
<h3>3.5.3 (4-19-2013):</h3>
<ul><li>Add support for portable areas without a standard area folder</li></ul>
<h3>3.5.2 (3-07-2013):</h3>
<ul><li>Add support for inherited controller attributes. <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/4194">http://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/4194</a></li></ul>
<h3>3.5.1 (2-25-2013):</h3>
<ul><li>If static files include a timestamp, previously for minified CSS- and JavaScript-files the timestamp was generated by taking the last change time of the unminified file. <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4122">https://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4122</a></li></ul>
<h3>3.5.0 (2-08-2013):</h3>
<ul><li>Sign T4MVCExtensions.dll <a href="http://t4mvc.codeplex.com/discussions/432534">http://t4mvc.codeplex.com/discussions/432534</a></li>
<li>Call T4Extension.TimestampString through delegate for unit testing <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4040">http://t4mvc.codeplex.com/SourceControl/network/forks/rmarcush/t4mvc/contribution/4040</a></li></ul>
<h3>3.4.1 (1-31-2013):</h3>
<ul><li>Make T4MVCHelpers internal to avoid cross project conflicts <a href="http://t4mvc.codeplex.com/workitem/17">http://t4mvc.codeplex.com/workitem/17</a></li></ul>
<h3>3.4.0 (1-23-2013):</h3>
<ul><li>Add optional support for async methods <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/3958">https://t4mvc.codeplex.com/SourceControl/network/forks/mswainatwork/t4mvc/contribution/3958</a></li>
<li>Generate partial methods to allow custom &quot;overloading&quot; of the return values.</li></ul>
<h3>3.3.0 (1-16-2013):</h3>
<ul><li> Add support for support for model unbinder providers <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/Augi/T4MVCUnbinderProvider/contribution/3879">https://t4mvc.codeplex.com/SourceControl/network/forks/Augi/T4MVCUnbinderProvider/contribution/3879</a></li>
<li> Fix handling of &quot;completed&quot; methods <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/phw/t4mvc/contribution/3922">https://t4mvc.codeplex.com/SourceControl/network/forks/phw/t4mvc/contribution/3922</a></li></ul>
<h3>3.2.1 (12-27-2012):</h3>
<ul><li> Fix issue with VB projects causing exceptions <a href="http://t4mvc.codeplex.com/workitem/7">http://t4mvc.codeplex.com/workitem/7</a></li></ul>
<h3>3.2.0 (12-11-2012):</h3>
<ul><li> Add option to make parameter names constants <a href="https://t4mvc.codeplex.com/SourceControl/network/forks/WayneBrantley/ParameterNamesToConst/contribution/3762">https://t4mvc.codeplex.com/SourceControl/network/forks/WayneBrantley/ParameterNamesToConst/contribution/3762</a></li></ul>
<h3>3.1.0 (12-09-2012):</h3>
<ul><li>Added JavaScriptReplacableUrl helper <a href="http://t4mvc.codeplex.com/discussions/405911">http://t4mvc.codeplex.com/discussions/405911</a></li></ul>
<h3>3.0.3 (11-30-2012):</h3>
<ul><li>Fix to deal with multiple attributes <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/ArtiomChi/t4mvc/contribution/3723">http://t4mvc.codeplex.com/SourceControl/network/forks/ArtiomChi/t4mvc/contribution/3723</a></li></ul>
<h3>3.0.2 (11-17-2012):</h3>
<ul><li>Add support for generic result types <a href="http://t4mvc.codeplex.com/SourceControl/network/forks/ryanrust/T4MVC/contribution/3653">http://t4mvc.codeplex.com/SourceControl/network/forks/ryanrust/T4MVC/contribution/3653</a></li></ul>
<h3>3.0.1 (11-16-2012):</h3>
<ul><li>Fix T4MVC.tt.settings.xml so it only gets generated when needed <a href="https://t4mvc.codeplex.com/discussions/403390">https://t4mvc.codeplex.com/discussions/403390</a></li></ul>
<h3>3.0.0 (11-14-2012):</h3>
<ul><li>Move all the non-dynamic code to a separate T4MVCExtensions.dll assembly</li>
<li>Change generated code brace style to Allman</li>
<li>Added many new RouteLink/BeginRouteForm/RouteUrl helpers</li></ul>
<h3>2.13.0 (10-24-2012):</h3>
<ul><li>Move settings to T4MVC.tt.settings.xml XML file instead of tt file. See doc for details.</li>
<li>Make simple view names available alongside full names, e.g. MVC.Home.Views.SomeView vs MVC.Home.Views.ViewNames.SomeView</li></ul>
<h3>2.12.0 (10-16-2012):</h3>
<ul><li>Add support for static files in nested folders <a href="http://t4mvc.codeplex.com/workitem/6">http://t4mvc.codeplex.com/workitem/6</a></li>
<li>Add MVC 4 bundle starter classes <a href="https://t4mvc.codeplex.com/discussions/399205">https://t4mvc.codeplex.com/discussions/399205</a></li></ul>
<h3>2.11.2 (10-11-2012):</h3>
<ul><li>Removed optional params in ActionLink to support expression trees <a href="http://t4mvc.codeplex.com/workitem/4">http://t4mvc.codeplex.com/workitem/4</a></li>
<li>Change brace style of generated code to Allman</li></ul>
<h3>2.11.1 (10-10-2012):</h3>
<ul><li>Ignore methods that return generic types <a href="http://mvccontrib.codeplex.com/workitem/7178">http://mvccontrib.codeplex.com/workitem/7178</a></li></ul>
<h3>2.11.0 (10-09-2012):</h3>
<ul><li>Corrects the ActionParameters class for overloaded actions to list all parameters and not just the parameters from the first action found.</li></ul>
<h3>2.10.4 (10-05-2012):</h3>
<ul><li>Added attributes so it builds clean under Code Analysis <a href="http://t4mvc.codeplex.com/workitem/10">http://t4mvc.codeplex.com/workitem/10</a></li></ul>
<h3>2.10.3 (09-30-2012):</h3>
<ul><li>Fix crash when querystring contains a null key <a href="http://t4mvc.codeplex.com/discussions/396916">http://t4mvc.codeplex.com/discussions/396916</a></li></ul>
<h3>2.10.2 (09-17-2012):</h3>
<ul><li>Fix UnbindModel to avoid failing on duplicate entries <a href="http://t4mvc.codeplex.com/discussions/394529">http://t4mvc.codeplex.com/discussions/394529</a></li>
<li>Fix ModelUnbinder code generation when SplitIntoMultipleFiles is false <a href="http://t4mvc.codeplex.com/workitem/9">http://t4mvc.codeplex.com/workitem/9</a></li></ul>
<h3>2.10.1 (07-31-2012):</h3>
<ul><li>Fixed default param regression with model unbinder code (<a href="http://stackoverflow.com/questions/11566207/t4mvc-optionalparameter-values-implied-from-current-context/11603897">http://stackoverflow.com/questions/11566207/t4mvc-optionalparameter-values-implied-from-current-context/11603897</a>)</li></ul>
<h3>2.10.0 (07-03-2012):</h3>
<ul><li>Added support for custom model binders (<a href="https://t4mvc.codeplex.com/discussions/357386">https://t4mvc.codeplex.com/discussions/357386</a>)</li>
<li>Fixed unreachable code warning</li></ul>
<h3>2.9.0 (06-22-2012):</h3>
<ul><li>Added support for minified css files (<a href="https://t4mvc.codeplex.com/discussions/360443">https://t4mvc.codeplex.com/discussions/360443</a>)</li>
<li>Replaced improper new RouteValueDictionary usage on htmlAttributes</li></ul>
<h3>2.8.1 (04-12-2012):</h3>
<ul><li>Also default to https for the default (no param) action overload</li>
<li>Make T4MVCHelpers class public so that test code in a different assembly can access it</li></ul>
<h3>2.8 (03-25-2012):</h3>
<ul><li>Generate parameter constants for action methods. e.g. MVC.MyController.MethodParams.someParam</li>
<li>Default to https for Action Methods marked as RequireHttps (either at controller or action level)</li></ul>
<h3>2.7.0 (03-09-2012):</h3>
<ul><li>Removed support for MVC earlier than 3, and for CLR earlier than 4.0</li>
<li>Fix ActionLink to work with MVC4 (<a href="http://mvccontrib.codeplex.com/workitem/7191">http://mvccontrib.codeplex.com/workitem/7191</a>)</li></ul>
<h3>2.6.68 (02-03-2012):</h3>
<ul><li>Ignore static ctors when looking for ctors (<a href="http://mvccontrib.codeplex.com/workitem/7185">http://mvccontrib.codeplex.com/workitem/7185</a>)</li></ul>
<h3>2.6.67 (12-24-2011):</h3>
<ul><li>Restore Actions token that wasn&#39;t obsolete after all. Oops. (<a href="http://stackoverflow.com/questions/8625462/t4mvc-actions-token">http://stackoverflow.com/questions/8625462/t4mvc-actions-token</a>)</li></ul>
<h3>2.6.66 (12-22-2011):</h3>
<ul><li>Disable constant generation in UseLowercaseRoutes mode (<a href="http://stackoverflow.com/questions/8605868/t4mvc-2-6-65-and-uselowercaseroutes-true-error">http://stackoverflow.com/questions/8605868/t4mvc-2-6-65-and-uselowercaseroutes-true-error</a>)</li>
<li>Remove obsolete Actions token (<a href="http://stackoverflow.com/questions/8536269/what-is-the-difference-between-these-2-definitions-in-t4mvc/8543510">http://stackoverflow.com/questions/8536269/what-is-the-difference-between-these-2-definitions-in-t4mvc/8543510</a>)</li></ul>
<h3>2.6.65 (12-06-2011):</h3>
<ul><li>Add true constant strings for use in attributes (<a href="http://mvccontrib.codeplex.com/workitem/7177">http://mvccontrib.codeplex.com/workitem/7177</a>)</li></ul>
<h3>2.6.64 (10-21-2011):</h3>
<ul><li>Fix issue when action parameter name is escaped using @ syntax (e.g. int @event)</li></ul>
<h3>2.6.63 (10-13-2011):</h3>
<ul><li>Move hard coded T4MVC namespace into settings file</li></ul>
<h3>2.6.62 (08-13-2011):</h3>
<ul><li>Replace some unwanted tab characters with whitespace</li></ul>
<h3>2.6.61 (08-01-2011):</h3>
<ul><li>Ignore generic action methods (<a href="http://mvccontrib.codeplex.com/workitem/7156">http://mvccontrib.codeplex.com/workitem/7156</a>)</li></ul>
<h3>2.6.60 (07-28-2011):</h3>
<ul><li>Added support for portable areas. Enabled by adding area names to PortableAreas in T4MVC.tt.settings.t4</li>
<li>When generating links and views, if the folder name is the same as the parent, add a modifier to avoid class name conflicts (<a href="http://mvccontrib.codeplex.com/workitem/7153">http://mvccontrib.codeplex.com/workitem/7153</a>)</li></ul>
<h3>2.6.59 (07-12-2011):</h3>
<ul><li>Added commented out logic to show how to debug into the template (<a href="http://mvccontrib.codeplex.com/workitem/7144">http://mvccontrib.codeplex.com/workitem/7144</a>)</li>
<li>Ignore any class which name doesn&#39;t end with &quot;Controller&quot;</li></ul>
<h3>2.6.58 (06-24-2011):</h3>
<ul><li>Change the controller detection logic to be more reliable and ignore anything that doesn&#39;t extend Controller.</li></ul>
<h3>2.6.57 (06-21-2011):</h3>
<ul><li>Re-added Html.ActionLink/Url.Action overload without default params to avoid running into &quot;CS0854: An expression tree may not contain a call or invocation that uses optional arguments&quot;</li>
<li>Make ProcessControllerActionMethods look for ControllerBase instead of Controller to support controllers like MailerBase (from ActionMailer) which extend ControllerBase.</li></ul>
<h3>2.6.56 (06-05-2011):</h3>
<ul><li>Added optional Html.ActionLink parameters for protocol, hostname and fragment (<a href="http://stackoverflow.com/questions/6280347/how-can-i-add-a-hash-fragment-to-t4mvc-route-dictionary-actionresult/6302703">http://stackoverflow.com/questions/6280347/how-can-i-add-a-hash-fragment-to-t4mvc-route-dictionary-actionresult/6302703</a>)</li></ul>
<h3>2.6.55 (06-05-2011):</h3>
<ul><li>Added optional Url.Action parameters for protocol and hostname (<a href="http://stackoverflow.com/questions/6240568/t4mvc-doesnt-work-property-with-url-action">http://stackoverflow.com/questions/6240568/t4mvc-doesnt-work-property-with-url-action</a>)</li></ul>
<h3>2.6.54 (04-23-2011):</h3>
<ul><li>Added missing license to NuGet package and fixed some links. No actual template changes!</li></ul>
<h3>2.6.53 (04-18-2011):</h3>
<ul><li>Ignore actions marked as obsolete (<a href="http://mvccontrib.codeplex.com/workitem/7133">http://mvccontrib.codeplex.com/workitem/7133</a>)</li></ul>
<h3>2.6.52 (04-14-2011):</h3>
<ul><li>Moved the &#39;Dummy&#39; class under the GenerateMvcT4Extensions check</li>
<li>Always include the area token in the route values unless running on MVC 1.x</li></ul>
<h3>2.6.51 (04-12-2011):</h3>
<ul><li>Ignore async completion methods as they can&#39;t really be used in T4MVC, and can cause issues (<a href="http://stackoverflow.com/questions/5419173/t4mvc-asynccontroller">http://stackoverflow.com/questions/5419173/t4mvc-asynccontroller</a>)</li></ul>
<h3>2.6.50 (04-08-2011):</h3>
<ul><li>Added AddTimestampToStaticLink() method to settings file to allow more granular decision (per <a href="http://mvccontrib.codeplex.com/workitem/7129">this post</a>)</li>
<li>Added GenerateMvcT4Extensions settings flag to omit the generation of the System.Web.Mvc.T4Extensions class, which can be useful if it is already defined in a referenced library (see <a href="http://stackoverflow.com/questions/5563163/t4mvc-use-extension-methods-in-control-library/5574227">this post</a>)</li></ul>
<h3>2.6.44 (03-10-2011):</h3>
<ul><li>Added UseNonQualifiedViewNames flag which when set to true causes view names never to be fully qualified. Spark users may need that.</li></ul>
<h3>2.6.43 (02-24-2011):</h3>
<ul><li>Renamed T4MVC.settings.t4 to T4MVC.tt.settings.t4 so it feels more like a &#39;child&#39; file of T4MVC.tt</li></ul>
<h3>2.6.42 (02-01-2011):</h3>
<ul><li>Fix partial view support for MVC</li>
<li>Fix partial view support when name has periods (<a href="http://mvccontrib.codeplex.com/workitem/7113">http://mvccontrib.codeplex.com/workitem/7113</a>)</li></ul>
<h3>2.6.41 (01-17-2011):</h3>
<ul><li>Added AJAX BeginForm overloads</li></ul>
<h3>2.6.40 (01-05-2011):</h3>
<ul><li>Added BeginForm overload that just takes an ActionResult</li>
<li>Fix MapRouteArea to use UseNamespaceFallback when there are no namespaces</li></ul>
<h3>2.6.32 (12-15-2010):</h3>
<ul><li>Fix bug in controller name generation when IncludeAreasToken is true</li></ul>
<h3>2.6.31 (11-15-2010):</h3>
<ul><li>Improve error message when T4MVC generated files are out of date.</li>
<li>Changed some &#39;const bool&#39; settings to &#39;static bool&#39; to avoid unused code warnings.</li>
<li>Disabled regen optimization added in 2.6.14 since it doesn&#39;t catch view changes</li></ul>
<h3>2.6.30 (09-05-2010):</h3>
<ul><li>Changed ExplicitHtmlHelpersForPartials flag to be off by default (and fix a small issue when it&#39;s off)</li>
<li>Handled System.NotImplementedException if project type (e.g. Installer) does not implement CodeModel property</li>
<li>Fixed issue when action method params are all optional (<a href="http://stackoverflow.com/questions/3488610/t4mvc-and-named-parameters">http://stackoverflow.com/questions/3488610/t4mvc-and-named-parameters</a>)</li>
<li>Exclude Area related methods when using MVC 1.0, as that was breaking things</li>
<li>Added logic to special case DisplayTemplates/EditorTemplates folders, since they need short view names passed in</li></ul>
<h3>2.6.21 (07-20-2010):</h3>
<ul><li>Fix to the partial extension feature added in 2.6.20 to deal with conflicts</li></ul>
<h3>2.6.20 (07-19-2010):</h3>
<ul><li>Added extension methods to render partial views (see <a href="http://www.weirdlover.com/2010/05/12/t4mvc-extension-for-mvc-partials/">this post</a>)
<ul><li>e.g. Html.RenderPartial(&quot;Map&quot;, Model.Dinner); --&gt; Html.RenderMap(Model.Dinner);</li>
<li>Can be turned off in settings file via ExplicitHtmlHelpersForPartials flag.</li></ul></li></ul>
<h3>2.6.15 (05-16-2010):</h3>
<ul><li>Added missing MapRoute overloads to support namespaces</li>
<li>Added MapRoute extensions on AreaRegistrationContext to support areas. Had to name them MapRouteArea to avoid clash with existing MapRoute methods :(</li></ul>
<h3>2.6.14 (05-06-2010):</h3>
<ul><li>Added UseLowercaseRoutes flag to lower case the area, controller and action names in routes</li>
<li>Added support for Views folders that don&#39;t match a controller name.</li>
<li>Added optimization to not regenerate files when the controller has not changed since the last generation</li>
<li>Turn AlwaysKeepTemplateDirty to false by default. We now have an <a href="http://blogs.msdn.com/davidebb/archive/2010/03/18/an-even-better-way-to-run-t4mvc-a-vs-addin.aspx">addin</a> which provides a better solution to this</li></ul>
<h3>2.6.13 (03-08-2010):</h3>
<ul><li>Added AddTimestampToStaticLinks flag to T4MVC.settings.t4 to generate static links that change when the file changes.</li>
<li>Added support for [Bind(Prefix = &quot;newParamName&quot;)] attribute so it generates the correct route value</li>
<li>Added an AddRouteValues overload that takes NameValueCollection, e.g.
<ul><li>MVC.Home.About().AddRouteValues(Request.QueryString)</li></ul></li>
<li>Added MapRoute overload that supports contraints</li>
<li>Removed some logic to support VS2010 Beta 2. VS2010 RC or later should now be used.</li></ul>
<h3>2.6.12 (01-15-2010):</h3>
<ul><li>Fixed issue where some special project types (e.g. DB projects) were throwing while enumerating over the list</li>
<li>Changed to use GeneratedCode attribute instead of the less correct CompilerGenerated</li>
<li>Fixed CompilerGenerated/DebuggerNonUserCode attributes so they don&#39;t incorrectly affect the control classes</li>
<li>Change to avoid adding area to route if the app is not using areas</li></ul>
<h3>2.6.11 (01-10-2010):</h3>
<ul><li>Added ExcludedStaticFileExtensions setting to T4MVC.settings.t4 to list extensions for which static links should not be generated.</li>
<li>Support configurable name for IT4MVCActionResult, and it being defined externally (for sharing pourpose)</li>
<li>Added DebuggerNonUserCode attribute to generated classes</li>
<li>Improved error handling when trying to call T4MVC method with real ActionResult (previous threw InvalidCast)</li>
<li>Fix issue when overridden action methods were incorrectly marked as virtual</li></ul>
<h3>2.6.10 (01-04-2010):</h3>
<ul><li>Added support for adding arbitrary route parameters to T4MVC actions. e.g.
<ul><li>MVC.Home.About().AddRouteValue(&quot;fooKey&quot;, bar.Foo.Key)</li>
<li>MVC.Home.About().AddRouteValues(new {fooKey = bar.Foo.Key, barKey = bar.Key})</li></ul></li>
<li>Added shorter to refer to controller actions from with the controller itself. e.g.
<ul><li>return RedirectToAction(MVC.MyController.Actions.About()); BECOMES:</li>
<li>return RedirectToAction(Actions.About());</li></ul></li>
<li>What was previously called Actions was renamed to ActionNames (note, that&#39;s a BREAKING CHANGE if you used Actions before!)</li>
<li>Ignore controller methods that are marked with a NonAction attribute</li>
<li>Renamed IT4MVCActionResult.RouteValues to avoid conflict (this should not break anything, as it&#39;s only used internally)</li></ul>
<h3>2.6.03 (12-10-2009):</h3>
<ul><li>Generate full view paths to allow cross controller references
<ul><li>e.g. MVC.Dinners.Views.DinnerForm is now &quot;~/Views/Dinners/DinnerForm.ascx&quot; instead of just &quot;DinnerForm&quot;</li></ul></li>
<li>Fix compile error when a view name is a language keyword (e.g. string.ascx)</li></ul>
<h3>2.6.02 (12-04-2009)</h3>
<ul><li>Added way to get area name from both Area and Controller objects
<ul><li>e.g. MVC.MyArea.Name and MVC.MyArea.MyController.Area</li></ul></li>
<li>Added support for controllers in the default namespace (i.e. no namespace)</li>
<li>Always include the area in the route data, even when it&#39;s null/empty</li></ul>
<h3>2.6.01 (12-02-2009)</h3>
<ul><li>Fix compile error when a custom ActionResult type has a ctor that takes a value type</li></ul>
<h3>2.6.00 (11-28-2009)</h3>
<ul><li>Added support for MVC 2 Areas</li>
<li>Fixed issue where non-existing RenderAction method gets generated on VS2010 Beta 2</li>
<li>Added check to give proper error when attempting to run T4MVC outside VS (e.g. from TextTransform.exe)</li></ul>
<h3>2.5.02 (11-24-2009)</h3>
<ul><li>Change links in comment to point to new T4MVC home and forum</li>
<li>Fix scenario where a View folder as a name that&#39;s a C# keyword</li></ul>
<h3>2.5.01 (11-20-2009)</h3>
<ul><li>Added support for Html.RenderAction and Html.Action (see http://haacked.com/archive/2009/11/18/aspnetmvc2-render-action.aspx)</li>
<li>Fix null ref exception issue when custom ActionResult type doesn&#39;t have any explicit ctors</li></ul>
<h3>2.5.00 (11-16-2009)</h3>
<ul><li>Incorporated Damien Guard&#39;s multiple output manager to (optionally) split output from T4MVC into separate files to improve source control</li>
<li>Added support for minified javascript files in production</li>
<li>Fixed bug occurring when no action is of type ActionResult</li></ul>
<h3>2.4.04 (10-15-2009)</h3>
<ul><li>Added support for MVC 2 by detecting the version and generating slightly different code</li></ul>
<h3>2.4.03 (10-02-2009)</h3>
<ul><li>Added ProcessVirtualPath method to T4MVC.settings.t4 so user can write custom logic to modify client URL&#39;s</li>
<li>Greatly simplified GetProjectContainingT4File logic by using FindProjectItem().</li>
<li>Renamed generated classes to be CLS compliant</li>
<li>Moved most of the doc and versioning comments from T4MVC.tt into the readme.txt file, as it was getting a bit long.</li></ul>
<h3>2.4.02 (09-02-2009)</h3>
<ul><li>Added a setting in T4MVC.settings.t4 to set the namespace that Links get generated in</li>
<li>Added pragma to prevent compiler from complaining about missing Xml comments</li>
<li>Added &lt;auto-generated /&gt; comment to disable StyleCop in generated file</li>
<li>Fixed issue when using a custom ResultType in a custom namespace. Now fully qualifying result types.</li></ul>
<h3>2.4.01 (07-29-2009):</h3>
<ul><li>Put all the generated code in a T4MVC #region. This is useful to tell tools like ReSharper to ignore it.</li>
<li>Fixed issue where controller methods returning generic types cause template to blow up</li>
<li>Added a setting in T4MVC.settings.t4 to turn off the behavior that always keeps the template dirty</li></ul>
<h3>2.4.00 (07-28-2009):</h3>
<ul><li>Added support for configurable settings in a separate T4MVC.settings.t4 file</li>
<li>Added a parameter-less pseudo-action for every action that doesn&#39;t already have a parameter-less overload</li>
<li>Added support for having T4MVC.tt in a sub folder instead of always at the root of the project</li>
<li>Fixed issue when a base controller doesn&#39;t have a default ctor</li>
<li>Added T4Extensions into System.Web.Mvc namespace to fix ambiguous resolution issue </li>
<li>Misc cleanup</li></ul>
<h3>2.3.01 (07-10-2009):</h3>
<ul><li>Fixed issue with <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName&referringTitle=T4MVC_History">ActionName</a> attribute set to non literal string values (e.g. <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName%28SomeConst%20%2b%20%22Abc%22%29&referringTitle=T4MVC_History">ActionName&#40;SomeConst &#43; &#34;Abc&#34;&#41;</a>)</li>
<li>Fixed duplication issue when partial controller classes have a base type which contains action methods</li>
<li>Skip App_LocalResources when processing views</li>
<li>Cleaned up rendering logic</li></ul>
<h3>2.3.00 (07-07-2009):</h3>
<ul><li>Added support for sub view folders</li>
<li>Added support for <a href="https://t4mvc.codeplex.com/wikipage?title=ActionName&referringTitle=T4MVC_History">ActionName</a> attribute</li>
<li>Improved handling when the controller comes from a different project</li>
<li>Don&#39;t try to process generic controller classes</li></ul>
<h3>2.2.03 (07-06-2009):</h3>
<ul><li>Added support for action methods defined on controller base classes</li>
<li>Improved error handling when not able to change actions to virtual and controllers to partial</li></ul>
<h3>2.2.02 (07-01-2009):</h3>
<ul><li>Fixed break caused by incorrect support for derived ActionResult types in 2.2.01</li>
<li>Fixed issue with duplicate view tokens getting generated when you have both foo.aspx and foo.ascx</li></ul>
<h3>2.2.01 (07-01-2009):</h3>
<ul><li>Added support for action methods that return a type derived from ActionResult (as opposed to exactly an ActionResult)</li>
<li>Fixed issue when controller is using partial classes</li>
<li>Fixed folder handling logic to deal with generated files</li>
<li>Fixed issue with folder names that are C# keyword</li>
<li>Throw NotSupportedException instead of NotImplementedException to avoid being viewed as a TODO</li></ul>
<h3>2.2.00 (06-30-2009):</h3>
<ul><li>Added strongly typed support to MapRoute</li>
<li>Changed constructor generation to avoid confusing IoC containers</li>
<li>Fixed issue with empty Content folder</li>
<li>Fixed issue with abstract controller base classes</li></ul>
<h3>2.1.00 (06-29-2009):</h3>
<ul><li>Added Html.BeginForm overloads that use the strongly typed pattern</li>
<li>Added Url() helpers on static resources to increase flexibility</li>
<li>Changed generated constants (view and action names, static files) to be readonly strings</li>
<li>Fixed null ref exception in Solution Folder logic</li></ul>
<h3>2.0.04 (06-28-2009):</h3>
<ul><li>Fixed issue with files and folders with names starting with a digit</li></ul>
<h3>2.0.03 (06-27-2009):</h3>
<ul><li>Rework code element enumeration logic to work around a VS2010 issue. The template should now work with VS2010 beta 1!</li>
<li>Reduced some redundancy in the generated code</li></ul>
<h3>2.0.02 (06-27-2009):</h3>
<ul><li>Added ActionLink overloads that take object instead of dictionary (from both Html and Ajax)</li></ul>
<h3>2.0.01 (06-26-2009):</h3>
<ul><li>Fixed issue with files and folders with invalid identifier characters (e.g. spaces, &#39;-&#39;, &#39;.&#39;)</li></ul>
<h3>2.0.00 (06-26-2009):</h3>
<ul><li>Added support for refactoring in Action methods</li>
<li>The T4 file automatically runs whenever you build, instead of being done manually</li>
<li>Support for strongly typed links to static resources</li>
<li>Fix: supports controllers that are in sub-folders of the Controllers folder and not directly in there</li>
<li>Fix: works better with nested solution folder </li>
<li>Random other small fixes</li></ul>
<h3>1.0.xx (06-17-2009):</h3>
<ul><li>the original based on <a href="http://blogs.msdn.com/davidebb/archive/2009/06/17/a-new-and-improved-asp-net-mvc-t4-template.aspx">this post</a></li></ul>
</div><div class="ClearBoth"></div>davidebboFri, 19 Apr 2013 20:50:53 GMTUpdated Wiki: T4MVC_History 20130419085053P