This project is read-only.


Running transformation: System.InvalidCastException


I am getting following error while running file. Can you please review and help me :

Error 3 Running transformation: System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'VSLangProj.VSProject'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{2CFB826F-F6BF-480D-A546-95A0381CC411}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
at Microsoft.VisualStudio.TextTemplatingDDBB1C2E3C4B0A049C4790EE294E077DC156BC97F1975EE8CBB1B539907CE0B80C8607D41D291E229D4D5F437D301BC7148A773A75072335FEC83A5BD1C5CDBF.GeneratedTextTransformation.GetMvcVersion() in e:\dev\projects\ytk-web-1.0\YTK.WEB\T4MVC\ 581
at Microsoft.VisualStudio.TextTemplatingDDBB1C2E3C4B0A049C4790EE294E077DC156BC97F1975EE8CBB1B539907CE0B80C8607D41D291E229D4D5F437D301BC7148A773A75072335FEC83A5BD1C5CDBF.GeneratedTextTransformation.PrepareDataToRender(TextTransformation tt) in e:\dev\projects\ytk-web-1.0\YTK.WEB\T4MVC\ 572
at Microsoft.VisualStudio.TextTemplatingDDBB1C2E3C4B0A049C4790EE294E077DC156BC97F1975EE8CBB1B539907CE0B80C8607D41D291E229D4D5F437D301BC7148A773A75072335FEC83A5BD1C5CDBF.GeneratedTextTransformation.TransformText() in e:\dev\projects\ytk-web-1.0\YTK.WEB\T4MVC\ 33 e:\dev\projects\ytk-web-1.0\YTK.WEB\T4MVC\ 581 1 E:...\YTK.WEB\
Closed Jan 28, 2015 at 4:10 PM by KevinKuszyk
As part of our move to GitHub, we are closing all the outstanding issues on CodePlex.

If your issue is still valid, please re-open it on GitHub:

Thanks for contributing!


davidebbo wrote Dec 17, 2013 at 5:43 PM

What version of T4MVC is that with? The latest doesn't have a GetMvcVersion method at all. Can you try updating?

ravigarg1985 wrote Dec 19, 2013 at 4:13 PM

i am using T4MVC Version 2.6.21 version. i am using MVC 2 and DOT NET version 4.0

Can you please show me link where i can download latest file in this website? all i can see now is source code file but not file.

davidebbo wrote Dec 19, 2013 at 4:57 PM

T4MVC is distributed exclusively via NuGet. I would suggest updating to both a newer MVC and T4MVC. MVC2 is really ancient!

cblaze22 wrote Dec 23, 2013 at 6:48 AM

I have always had this issue. It happens every once in a while and Im not sure why. Have to restart VS.

davidebbo wrote Dec 23, 2013 at 7:59 PM

It sounds more like a VS glitch than a T4MVC issue

cblaze22 wrote Dec 23, 2013 at 9:36 PM

Might be but it works with another project just fine, and not at all with this one project. Even after restart it wont even work for me.

cblaze22 wrote Dec 23, 2013 at 9:39 PM

Ha removing the project from the solution and re-adding fixed it!