0
我正在使用Visual Studio 2015更新3。我試着用TextTransform.exe與DP標誌,但我得到這個錯誤:使用VS 2015生成生成T4的錯誤
texttransform -out "P:\<Path to project>\Model.cs" -I "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes" -dp T4VSHost"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Microsoft.Data.Entity.Design.dll" "P:\<Path to project>\Model.tt"
其他問題我擡起頭:
產生錯誤C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes\EF6.Utility.CS.ttinclude(1,4): error : A processor named 'T4VSHost' could not be found for the directive named 'CleanupBehavior'. The transformation will not be run. The following Exception was thrown:
System.IO.FileNotFoundException: Failed to load directive processor T4VSHost. ---> System.IndexOutOfRangeException: L'index se trouve en dehors des limites du tableau.
à Microsoft.VisualStudio.TextTemplating.CommandLine.DirectiveProcessorConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
à Microsoft.VisualStudio.TextTemplating.CommandLine.CommandLineHost.ResolveDirectiveProcessor(String processorName)
à Microsoft.VisualStudio.TextTemplating.CommandLine.CommandLineHost.ResolveDirectiveProcessor(String processorName)
à Microsoft.VisualStudio.TextTemplating.Engine.ProcessCustomDirectives(ITextTemplatingEngineHost host, TemplateProcessingSession session, IEnumerable`1 directivesToBeProcessed)
線
- Get Visual Studio to run a T4 Template on every build(我用接受的答案作爲基數)
- Processor Named ‘T4VSHost’ Could Not Be Found For The Directive Named ‘CleanupBehavior’
- Generating T4 on Build using VS 2012(不靈活,因爲一個批處理文件)
我知道到目前爲止,所有的路徑是正確的,並且T4VSHost在我的註冊表的定義是正確的。
限制:
- 我不能修改/移動.TT文件
- 我不能移動裝配文件或ttinclude文件(雖然我試過)
我非常喜歡避免修改EF.CS.ttinclude文件。什麼可能導致這個問題?
非常感謝!我已經把這個問題交給了其他人,但我會試着去看看它是否能解決問題。 – Kinou