0

Yesterday I was having fully compiled ASP.NET MVC 3.0 project. Today when i opened my project again it is wont compiled because of T4MVC, I was very surprised.

I readd the T4MVC template thorough NuGet again, but it is didn't help. Then i removed all related T4 VS 2010 extensions: T4 Editor, T4Utilites, and Visual T4, opened project again but it is didn't help, than i rebooted and installed T4 extensions again but it is didn't help either. Than i created new clean ASP.NET MVC 3.0 project and add T4MVC to this, and I've got the same errors (see peintscreen).

If i remove T4MVC.tt from solution than I can compile the project, but when i am put it back, I am getting errors again.

Error screen 1

Open Error screen 1

Error screen 2

Open Error screen 2

I think that the problem with Visual Studio, and now I have a very bad idea - try to reinstall Visual Studio, but may be some one may suggest something better?

p.s 1

Also I didn't install anything related to Visual Studio this days, may be only a couple of small Upstates through windows update, but they wasn't related to visual studio.

Also i have MVC 3.0 Updates tools' installed, but before today everything was working well.

It is looking very strange, i can generate *.cs files successfully using this template, there is no errors i am getting during this process, but visual studio blaming T4MVC.tt fore some reason.

p.s 2

Actually also NuGet package where updated. May be it is the case? mmm... But after removing NuGet all the same :(

angularrocks.com
  • 26,767
  • 13
  • 87
  • 104
  • Try this - Open the T4MVC.tt file and recompile again. Sometimes you have to have the TT file open in the editor for this to work. There are tolls available which rebuild T4 templates in the background for you in VS, without having the TT file open. You could also try deleting the `.cs` files associated with T4MVC.TT (except T4MVC.cs) and rebuilding the project. – Jason Evans Apr 27 '11 at 10:37
  • @Jason Evans I did it as well, no way, the problem with *tt not with its *.cs files – angularrocks.com Apr 27 '11 at 10:39
  • Try deleting the T4MVC.TT completely from the project and putting it back in again. But no need to reinstall VS 2010, don't waste your time with doing that. This is a bit of stumper. – Jason Evans Apr 27 '11 at 10:47
  • @Jason Evans I did it as well. Without T4 there is no errors, but i need T4MVC back in the project and after I put it back a am getting the same errors. – angularrocks.com Apr 27 '11 at 10:49

1 Answers1

2

Ok, here is the 4 steps how to fix it (no Visual Studio uninstall required :) )

1) Remove T4MVC from project(remove T4MVC package reference)

2) Remove NuGet using Extension manager

3) Install NuGet back using Extension manager

4) Add T4MVC back.

after this magic steps i get it work.

angularrocks.com
  • 26,767
  • 13
  • 87
  • 104