I have a T4 Template file in my project and I use it everyday but after upgrade into 16.4.5 version I'm getting this error when I Run Custom Code:
Severity Code Description Project File Line Suppression State Error Running transformation: System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component. at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) at Microsoft.VisualStudio.LanguageServices.Implementation.Utilities.Exceptions.ThrowEFail() at Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel.FileCodeModel.GetDocument() at Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel.FileCodeModel.GetSyntaxTree() at Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel.FileCodeModel..ctor(CodeModelState state, Object parent, DocumentId documentId, ITextManagerAdapter textManagerAdapter) at Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel.CodeModelProjectCache.GetOrCreateFileCodeModel(String filePath, Object parent) at Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel.ProjectCodeModel.Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel.IProjectCodeModel.GetOrCreateFileCodeModel(String filePath, Object parent) at Microsoft.VisualStudio.LanguageServices.CSharp.ProjectSystemShim.CSharpProjectShim.CreateFileCodeModel(String fileName, Object parent, FileCodeModel& ppFileCodeModel) at EnvDTE.ProjectItem.get_FileCodeModel() at Microsoft.VisualStudio.TextTemplatingA79231EE6EFCFD9A9F7580CC47D516BF0E336BDEE9E25B0EE85E3BDE9AA5F22021A94E93566B81968DF5D01D105C4011D1E60A396DC22B9D70AA7669950944CC.GeneratedTextTransformation.d__7.MoveNext() in XXX\SecurityKeys.tt:line 134 at Microsoft.VisualStudio.TextTemplatingA79231EE6EFCFD9A9F7580CC47D516BF0E336BDEE9E25B0EE85E3BDE9AA5F22021A94E93566B81968DF5D01D105C4011D1E60A396DC22B9D70AA7669950944CC.GeneratedTextTransformation.d__6.MoveNext() in XXX\SecurityKeys.tt:line 127 at Microsoft.VisualStudio.TextTemplatingA79231EE6EFCFD9A9F7580CC47D516BF0E336BDEE9E25B0EE85E3BDE9AA5F22021A94E93566B81968DF5D01D105C4011D1E60A396DC22B9D70AA7669950944CC.GeneratedTextTransformation.TransformText() in XXX\SecurityKeys.tt:line 48 MYPROJECT XXX\SecurityKeys.tt 134
I tested the same file in my colleague's workstation with previous version of VS and it worked.
just exclude all project files and folders then include them again! it works
User contributions licensed under CC BY-SA 3.0