简体   繁体   中英

T4MVC in ASP.NET MVC4 vs2013

I have legacy mvc3 project wich was migrated from mvc2. There is T4MVC in use. First of all i would like to mention that guys who migrated to MVC3 left ProjectTypeGuids for MVC2. I migrated to mvc4 by following http://www.asp.net/whitepapers/mvc4-release-notes#_Toc303253806 guidelines.

Now i am unable to open this project in vs2010 because its not supported, right?

After i succesfully migrated to mvc4 there was hundreds of errors in t4mvc generated classes and i could not run .tt custom tool again (error in .tt files method GetMvcVersion). I took newer t4mvc version from nugets.

Now, when i run T4MVC.tt custom tool my vs2013 express throw error "An unhandled microsoft .net framework exception occurred in VWDExpress.exe [6520]" and allows me to choose possible debuggers. After i choose vs2010 (not express) it runs succesfully.

http://t4mvc.codeplex.com/documentation is it posible to use it in vs2013? T4MVC Documentation page says not.

Over all i got few errors in Views like:

..Views\\Shared_PaginatePrevious.cshtml(14): error CS0234: The type or namespace name 'Assets' does not exist in the namespace 'Links' (are you missing an assembly reference?)

<img src="@(Links.Assets.Images.p_left_png)" alt="<" title="@(Shared.PreviousPage)" />

Do i have to add namespace Links to tt template ?

After commenting out all errors, my project is running succesfully.

Overall regarding on documentation wich says: T4MVC runs in both Visual Studio 2008 SP1 and Visual Studio 2010, and supports both ASP.NET MVC 1.0 and 2.0. http://t4mvc.codeplex.com/documentation

Does T4MVC is still in use today for MVC4+, and vs2012+? What should i do with VS2013 bug?

I have a .net 4.5 solution in VS2012 which is MVC4. This was upgraded from a .net 4 vs2010 MVC3 and during the upgrade I had to upgrade the version of T4MVC to 3.7.4 to get it to work.

I did have to uninstall T4MVC completely and re-install though through nuget. You will need the latest version however as 3.7.4 wont work with vs2013.

Check your version, do a complete uninstall and reinstall if you havent already done so and have a look here for further info from T4MVCs creator.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM