0

I'm using Visual Studio 2015 update 3. I tried using TextTransform.exe with the dp flag, but I got this error :

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)

Line that generated the error :

 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"

Other issues I looked up :

What I know so far is that all paths are correct and that T4VSHost's definition in my registry is correct.

Restrictions :

  • I cannot modify/move the .tt files
  • I cannot move assembly files or the ttinclude file (though I tried)

I would very much like to avoid modifying the EF.CS.ttinclude file. What could be causing this issue?

Community
  • 1
  • 1
Kinou
  • 3
  • 1
  • 3

1 Answers1

1

The dp switch is missing the class name, it should have name, full type name, and assembly of the directive processor.

Directive processor syntax:
-dp <processorName>!<className>!<assemblyName|codeBase>

Directive processor for CleanupBehavior:
-dp T4VSHost!Microsoft.Data.Entity.Design.VisualStudio.Directives.FallbackT4VSHostProcessor!"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Microsoft.Data.Entity.Design.dll"

Debra
  • 94
  • 1
  • 10
  • Thank you very much! I have passed the issue to someone else, but I'll try and see if it does solve it. – Kinou Sep 08 '16 at 13:39