Questions tagged [t4mvc]

T4MVC is an open source utility for Microsoft ASP.NET MVC. It allows replacing magic strings in Views, Controllers and Links to content with strong names/types.

T4MVC is an open source utility for Microsoft ASP.NET MVC. It allows replacing magic strings in Views, Controllers and Links to content with strong names/types.

Resources

244 questions
93
votes
4 answers

cannot implicitly convert type void to object. .NET MVC PartialViewResult

I have the following controller action: [ChildActionOnly] public virtual PartialViewResult ListActions(int id) { var actions = meetingActionRepository.GetAllMeetingActions(id); return PartialView(actions); } And the following action link…
MrBliz
  • 5,610
  • 14
  • 53
  • 81
21
votes
3 answers

T4MVC @Url.Action(MVC.Controller.Action()) Renders "?Area=" Parameter in QueryString

I am rendering a menu from a Partial Action directly to the layout, using: @Html.Action(MVC.Menu.Index()) This action, determines which Menu partial to render. For instance, a public menu partial. Within these partials, I am also using T4MVC to…
Jason Wicker
  • 3,326
  • 2
  • 23
  • 31
19
votes
1 answer

razor syntax with errors compiles when it should not compile

So I an into an error at runtime with my asp.net mvc3 app, when I checked the code I see that it has a red line on it, the error list says there is no such function defined but it will still compile fine. The error shows up only at runtime? I'm…
gideon
  • 18,841
  • 10
  • 69
  • 110
17
votes
2 answers

Strongly-typed T4MVC Action/ActionLink

I've been using T4MVC (FYI: v2.6.62) 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…
Dan Atkinson
  • 10,801
  • 12
  • 78
  • 106
11
votes
3 answers

T4MVC "run custom tool" generates EnvDTO 7.0 vs 8.0 csc warning

I'm getting the following warning when I right click on T4MVC.tt and select "run custom tool" (i.e. rebuild by T4MVC.cs file). Warning 1 Compiling transformation: Assuming assembly reference 'EnvDTE, Version=7.0.3300.0, Culture=neutral,…
Tod Thomson
  • 4,513
  • 2
  • 30
  • 33
10
votes
1 answer

Generate urls using T4MVC in a controller action

I am using t4mvc to generate links in my project. I would like to generate urls in a controller action, can this be done using t4mvc?
ilivewithian
  • 18,642
  • 19
  • 93
  • 158
10
votes
2 answers

How can I get T4MVC to regenerate the .generated.cs files?

I am adding tests to the NerdDinner DinnersController class, and when I create the constructors needed to do Constructor Injection I get a conflict with the T4MVC-generated constructor (specifically, the base constructor). It looks like the base…
DaveN59
  • 3,286
  • 8
  • 36
  • 49
10
votes
4 answers

Create a T4MVC ActionLink with url fragment

Is there a way to create a strongly typed T4MVC ActionLink with a hash/pound/fragment in it? For example, here is the link I'd like to create: Feed me But there's no extension to the T4MVC object that can do this. <%=…
Dan Atkinson
  • 10,801
  • 12
  • 78
  • 106
9
votes
3 answers

t4mvc : Cannot inherit a controller class which has no default constructor?

I am using T4MVC with MVC2. I have the following building blocks: A simple entity interface which defines that every POCO entity must have a long Id property: public interface IEntity { public long Id; } A simple POCO class which implements…
Stef Heyenrath
  • 7,870
  • 9
  • 54
  • 100
9
votes
1 answer

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 …
artvolk
  • 9,204
  • 11
  • 51
  • 83
9
votes
2 answers

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…
Luhmann
  • 3,772
  • 22
  • 32
8
votes
3 answers

ASP.Net T4MVC file not updating itself

I am wokring in ASP.Net MVC (.Net 4.0) with T4MVC template. So far this file was getting updated with entries automatically whenever I used to add new files into my project (like controllers, views, etc.). But for some reason, it has stopped…
Anil Soman
  • 2,357
  • 5
  • 34
  • 62
8
votes
2 answers

When will T4MVC support Razor with explicit HtmlHelpers for rendering partials?

I've been using T4MVC for some time now and love the "explicit HtmlHelpers for rendering partials" feature, which by default is switched off. I am using T4MVC version 2.6.40. I recently upgraded to MVC3 and noticed that no explicit HtmlHelpers are…
Shayne
  • 187
  • 1
  • 10
8
votes
1 answer

T4MVC is generating T4MVC.cs and T4MVC1.cs

VS2017 15.4.1 ASP.NET MVC 5.2.3 T4MVC 4.0.0 AutoT4MVC 1.5.3 Resharper I have been using T4MVC] for many months in this project without issue. However today each time I change a controller method it is generating two T4MVC files: instead of…
TheEdge
  • 7,981
  • 13
  • 55
  • 117
8
votes
1 answer

T4MVC failing to generate classes with ErrorGeneratingOutput

My MVC project has used T4MVC for scaffolding working fine for years. I made a change to the parameter inputs for one of my controller methods and for some reason when I ran "Run Custom Tool" to pick up the changes, it instead over wrote the…
Alec Menconi
  • 695
  • 1
  • 14
  • 31
1
2 3
16 17