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

前端 未结 3 1958
轻奢々
轻奢々 2020-12-18 00:07

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 th

3条回答
  •  生来不讨喜
    2020-12-18 00:35

    Seems you got it working, but let me add a few points here.

    About the need to import Microsoft.VisualStudio.TextTemplating.Interfaces, I added a comment about that at the top of T4MVC.tt. But yeah, it's easy to miss.

    Now for the confusing part: while those interfaces indeed moved to that different namespace in Beta2, the T4 team had a change of heart and decided to move them back again to the original namespace to avoid confusion. So when the next RC build comes out, this namespace will be gone.

    About the need to import DLLs, I'm surprised that you need this, as it works for me without it.

    Final note: in step #4, it should be harmless if you save here. What happens is that T4MVC has logic that keeps itself dirty, so even if you save, you'll see it marked as unsaved (this can be turned off in the settings file).

    Hope this helps!

提交回复
热议问题