Just heard about T4MVC but i can't get it to work in my sample project (ASP.NET MVC 2, Visual Studio 2008).
I get the following erros when trying to build the project:
Error 1 The type or namespace name 'Account' does not exist in the namespace 'Northwind.Web.MVC' (are you missing an assembly reference?) C:\Users\Bruno\Documents\My Dropbox\Projetos.NET\Northwind\Northwind.Web.MVC\AccountController.generated.cs 38 61 Northwind.Web.MVC
This is where the error occurs:
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public AccountController Actions { get { return MVC.Account; } }
I really hate magic strings, so please help me to make it work!
Looks like a namespace conflict between T4MVC and your code. Go to T4MVC.settings.t4 and find this code:
// The prefix used for things like MVC.Dinners.Name and MVC.Dinners.Delete(Model.DinnerID)
const string HelpersPrefix = "MVC";
Just change "MVC" to something else and you'll be on your way :)
Alternatively, you could rename your namespace if you prefer (Northwind.Web.MVC)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With