This may be a bug of Visual Studio. However, I can directly edit csproj file to include this assembly by adding a simple reference:
<ItemGroup>
<Reference Include="System" />
<Reference Include="Microsoft.VisualStudio.TextTemplating" />
</ItemGroup>
This works because the assembly is already in GAC just like other assemblies (e.g., System, System.Data).