T4 Template File doesn't compile VS2019 V16.4.5

0

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.

visual-studio
visual-studio-2019
t4
asked on Stack Overflow Feb 13, 2020 by Nader Vaghari

1 Answer

0

just exclude all project files and folders then include them again! it works

answered on Stack Overflow Feb 19, 2020 by Nader Vaghari

User contributions licensed under CC BY-SA 3.0