T4 Template Error

Mistake:

Error   48  A processor named 'PropertyProcessor' could not be found for the directive named 'property'. The transformation will not be run.  The following Exception was thrown:
System.IO.FileNotFoundException: Failed to resolve type for directive processor PropertyProcessor.
   at Microsoft.VisualStudio.TextTemplating.VSHost.TextTemplatingService.ResolveDirectiveProcessor(String processorName)
   at Microsoft.VisualStudio.TextTemplating.Engine.ProcessCustomDirectives(ITextTemplatingEngineHost host, TemplateProcessingSession session, List`1 directivesToBeProcessed)   Config.tt   2   4   

The T4 template was:

<#@ template language="C#" #>
<#@ property name="serverName" processor="PropertyProcessor" type="System.String" #>

using System;   

How can I fix this error? What does it mean?

+3
source share
1 answer

<# @property #> is a custom directive. It is not supported by the T4 host in Visual Studio. You can use the GAX host or provide an alternative implementation of PropertyProcessor, for example, included in the T4 editor from Clarius Consulting. More details here .

+6
source

Source: https://habr.com/ru/post/1715709/


All Articles