t4mvc

Does T4MVC work with Visual Studio 2010 Beta 2 and .Net 4?

I cannot get the current build of T4MVC (2.6.02) to work with an ASP.NET MVC 2 project compiled against .NET 4 in VS2010 Beta 2. There is one error: The C# 2.0 and C# 3.5 compilers are no longer supported. Templates will always be compiled with the version 4 compiler instead of 'v3.5' as specified. Which is easily fixed by changing ...

T4MVC Links for SEO

Hey guys, I'm trying to switch our links over to T4MVC, and I'm having a small problem with parameters that aren't part of an action's signature. We have a route that goes something like this: http://www.mydomain.com/{fooKey}/{barKey}/{barID} ==> leads to BarController.Details(barID). fooKey and barKey are only added to the links fo...

Cannot get T4MVC to work with VS2010 and ASP.NET MVC 2

I'm trying to add the T4MVC templates to my project, but I'm experiencing some problems. I went to Codeplex and downloaded the latest version of T4MVC, and according to the instructions I just copied the two files T4MVC.tt and T4MVC.Settings.t4 into the root of my web application. Immediately, I got the following errors: From T4MVC.cs ...

T4MVC renderpartial and Spark views

#Html.RenderPartial(MVC.Shared.Views._Sorter); throws error => There is no build provider registered for the extension '.spark'. You can register one in the section in machine.config or web.config. Make sure is has a BuildProviderAppliesToAttribute attribute which includes the value 'Web' or 'All'. Description: An unhandled ...

Broken Images on IIS7

I have a ASP.NET MVC site and it works just fine when I run it locally. Once I deploy that site to IIS 7 all links to resources are broken (ie. script files, images, css files). Could this be a route issue or would it be an IIS setting? Here are my routes: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRou...

Can you do a RunCustomTool with EnvDTE as a pre-build event?

I am using T4MVC, and I can't use a pre-build event to run TextTransform.exe as it relies on EnvDTE, and must be run with Visual Studio as host. If I have run custom tool once, it works nicely because it marks itself dirty when its executed (AlwaysKeepTemplateDirty = true), but when you open the solution, it doesn't run on build, so I w...

Strongly-typed T4MVC Action/ActionLink

I've been using T4MVC (FYI: v2.6.12) for quite some time, and I've been slowly moving over our code to this way of working (less reliance on magic strings). But I've had to stop because, for some reason, T4MVC is unable to translate objects into urls, and only seems to be able to work on primitive types (int/string/etc). Here is an exa...

Is there an equivalent of T4MVC for webforms?

I use T4MVC inside my asp mvc projects, mostly because it's brilliant. Is there an equivalent for asp webforms? ...

Does Visual Studio 2008 Express support t4?

I'm trying to use T4MVC in Visual Web Developer 2008 Express Edition and it's not building any files. Is T4 supported in the express editions? ...

T4MVC not generating an action

I suspected there was some hidden magic somewhere that stopped what looks like actual method calls all over the place in T4MVC. Then I had a view fail to compile, and the stackTrace went into my actual method. [Authorize] public string Apply(string shortName) { if (shortName.IsNullOrEmpty()) return "F...

problem with routing/T4MVC Url.Action()

I have these 2 routes : routes.MapRoute("Agenda", ConfigurationManager.AppSettings["eventsUrl"] + "/{year}/{month}", MVC.Events.Index(), new { year = DateTime.Now.Year, month = DateTime.Now.Month }); routes.MapRoute("AgendaDetail", ConfigurationManager.AppSettings["eventsUrl"] + "/{year}/{month}/{day}", MVC.Events.Detail(), new { year =...

Using T4MVC in real project

T4MVC is cool, but I have a couple of issues integrating it in my project, any help is really appriciated: I've got such warnings for all my actions (I use SnippetsBaseController as base class for all my controller classes: Warning 26 'Snippets.Controllers.ErrorController.Actions' hides inherited member 'Snippets.Controllers.Base.Sni...

Problem setting up T4MVC and MVC 2

I'm setting up T4MVC for MVC 2 on my website. I get 2 build errors: No overload for method 'RenderAction' takes 3 arguments in T4MVC.cs and No overload for method 'Action' takes 3 arguments in T4MVC.cs These are the ones in the T4MVC.cs file: public static void RenderAction(this HtmlHelper htmlHelper, ActionResult result) { ...

T4MVC and duplicate controller names in different areas

In my application I have controller named Snippets both in default area (in application root) and in my area called Manage. I use T4MVC and custom routes, like this: routes.MapRoute( "Feed", "feed/", MVC.Snippets.Rss() ); And I get this error: Multiple types were found that match the controller named 'snippets'. This c...

How to add reference an assembly that is not in the GAC from a t4mvc template (.tt)

I have found the place near the very top in a T4MVC template file (.tt) where assembly references can be added, which looks like: <#@ assembly name="System.Core" #> <#@ import namespace="System.Collections.Generic" #> However, it seems that I can only reference assemblies that are in the GAC. i.e. if I have an assembly MyProject.Stu...

Create a T4MVC ActionLink with hash/pound sign)

Is there a way to create a strongly typed T4MVC ActionLink with a hash in it? For example, here is the link I'd like to create: <a href="/Home/Index#food">Feed me</a> But there's no extension to the T4MVC object that can do this. <%= Html.ActionLink("Feed me", T4MVC.Home.Index()) %> So, what I end up having to do is create an acti...

AsyncController in MVC2 and T4MVC: can they work together?

Async actions in AsyncControllers (in MVC2) have two action methods (ActionNameAsync and ActionNameCompleted) which seem to confuse T4MVC. If it can't be done with T4MVC, is there a way to disable it from trying to include these methods? ...

MapRoute problem using T4MVC

Hello, I do use T4MVC v.2.6.15 I have following problem with registering routes. I didn't have it with default MVC route register. My problem route is following: AddRoute( routes, "Songs", //new { controller = "Songs", action = "List", performerUrlTitle = "", page = 1 } ); MVC.Songs.List( "", 1 ) // M...

RouteValueDictionary in querystring with t4mvc?

Hi, Whenever I use t4Mvc to create a form post Url, e.g. <% using (Html.BeginForm(MVC.Admin.Login.Index())) { %> It generates a route like the following: <form method="post" action="/admin/login/index?RouteValueDictionary=System.Web.Routing.RouteValueDictionary"> or when i use <% using (Html.BeginForm(MVC.Admin.Login.Index(nul...

How do I test rendered views when using T4MVC with TestHelper?

How do I test which view was rendered from a controller action if what I get is a T4MVC_ActionResult? Under normal circumstances I should be able to directly use TestHelper's methods, like in the examples: pooController.Details().AssertViewRendered().ForView("Details") ...but, since through T4MVC I get a T4MVC_ActionResult instead of ...