T4模板文件未编译VS2019 V16.4.5

问题描述 投票:0回答:1

我的项目中有一个T4模板文件,我每天都使用它,但是升级到16.4.5版本后,运行自定义代码时出现此错误:

严重级别描述项目文件行抑制状态运行转换错误:System.Runtime.InteropServices.COMException(0x80004005):错误HRESULT E_FAIL已从对COM组件的调用返回。在System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32errorCode,IntPtr errorInfo)Microsoft.VisualStudio.LanguageServices.Implementation.Utilities.Exceptions.ThrowEFail()在Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel.FileCodeModel.GetDocument()在Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel.FileCodeModel.GetSyntaxTree()在Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel.FileCodeModel..ctor(CodeModelState状态,父对象,DocumentId documentId,ITextManagerAdaptertextManagerAdapter)Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel.CodeModelProjectCache.GetOrCreateFileCodeModel(StringfilePath,对象父对象)位于Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel.ProjectCodeModel.Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel.IProjectCodeModel.GetOrCreateFileCodeModel(StringfilePath,对象父对象)位于Microsoft.VisualStudio.LanguageServices.CSharp.ProjectSystemShim.CSharpProjectShim.CreateFileCodeModel(StringfileName,对象父对象,FileCodeModel&ppFileCodeModel),位于EnvDTE.ProjectItem.get_FileCodeModel()在Microsoft.VisualStudio.TextTemplatingA79231EE6EFCFD9A9F7580CC47D516BF0E336BDEE9E25B0EE85E3BDE9AA5F22021A94E93566B81968DF5D01D105C4011D1E60A396DC22B9D70AA7669950944CC.GeneratedTextMoformation.d__)在XXX \ SecurityKeys.tt:第134行Microsoft.VisualStudio.TextTemplatingA79231EE6EFCFD9A9F7580CC47D516BF0E336BDEE9E25B0EE85E3BDE9AA5F22021A94E93566B81968DF5D01D105C4011D1E60A396DC22B9D70AA7669950944CC.GeneratedTextMoformation.d__6。在XXX \ SecurityKeys.tt:第127行Microsoft.VisualStudio.TextTemplatingA79231EE6EFCFD9A9F7580CC47D516BF0E336BDEE9E25B0EE85E3BDE9AA5F22021A94E93566B81968DF5D01D105C4011D1E60A396DC22B9D70AA7669950944CC.GeneratedTextTransformation.TransformText()在XXX \ SecurityKeys.tt:第48行MYPROJECT XXX \ SecurityKeys.tt 134

我在同事的工作站中使用以前的VS测试了相同的文件,并且可以正常工作。

visual-studio visual-studio-2019 t4
1个回答
0
投票
仅排除所有项目文件和文件夹,然后再次包括它们!有效
© www.soinside.com 2019 - 2024. All rights reserved.