Allow loading NuGet assemblies from t4 files
T4 is great but very limited in terms of the assemblies it can reference. You can only use assemblies in the GAC, or assemblies you have the absolute path for. However these days dependency management is done via NuGet and such dependencies don't go into the GAC. In addition, their path changes as versions are bumped. It would be very beneficial to support NuGet packages in t4 files, possibly by extending the "assembly" directive or even creating a new directive. For example:
<#@ nuget name="Newtonsoft.Json" version="9.0.1" #>
Simmilar issue of the same character: https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/18463615-allow-loading-nuget-assemblies-from-csx
Needless to say, an ideal solution would be one that is not dependent on the the VS text templating host, so automated build systems (mainly MSBuild or TextTransform.exe) could still employ it.
BTW this has been asked around the internet several times, for example: