Hello Folks,
I think I get to the right place.
I have following definition in *.csproj:
<ItemGroup><Compile Include="LIBAR_FRAES_INFO\SQL\Delete_Row.cs"><Generator>TextTemplatingFilePreprocessor</Generator><CustomToolNamespace>LiProd.Sql.LIBAR_FRAES_INFO</CustomToolNamespace><DependentUpon>Delete_Row.tt</DependentUpon><AutoGen>True</AutoGen><DesignTime>True</DesignTime><LastGenOutput>Delete_Row.cs</LastGenOutput></Compile></ItemGroup>
There also are a duplication of some definition:
<Content Include="LIBAR_FRAES_INFO\SQL\Delete_Row.tt"><Generator>TextTemplatingFilePreprocessor</Generator><CustomToolNamespace>LiProd.Sql.LIBAR_FRAES_INFO</CustomToolNamespace><LastGenOutput>Delete_Row.cs</LastGenOutput></Content>
I also can put any definition to any place in *.csproj or *.sln - files are generated.
I looking how to put a whot-is-defined in <CustomToolNamespace>LiProd.Sql.LIBAR_FRAES_INFO</CustomToolNamespace> for specific template as a namespace.
As far as I get - I do add an Import section to my *.csproj :
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v14.0\TextTemplating\Microsoft.TextTemplating.targets" /><PropertyGroup><TransformOnBuild>true</TransformOnBuild><TransformOutOfDateOnly>false</TransformOutOfDateOnly></PropertyGroup>
This force to re-compile T4 on the build, but as a Namespace are used following:
<PropertyGroup><!-- Unless another namespace has been specified, use the project namespace as the
default namespace from pre-processed files. --><PreprocessTemplateDefaultNamespace Condition=" $(PreprocessTemplateDefaultNamespace)=='' ">$(RootNamespace)</PreprocessTemplateDefaultNamespace></PropertyGroup>
Instead of RootNamespace for a whole project I need to use CustomToolNamespace for specific template.
As far as I understand a technology I need to import additional rules to overwrite existing PreprocessTemplateDefaultNamespace.
I do search for a *.targets which contain an example of using CustomToolNamespace, but didn't find any suitable.
Can somebody point me on documentation where are described process of creating *.targets?
or
Can somebody provide an example of *.targets which used CustomToolNamespace for a specific template?