Installing a T4 Template in a NuGet Package Generates Compilation Errors

I am creating a NuGet package that has T4 templates in it. After installing my NuGet package, T4 templates execute immediately because they are decorated with "TextTemplatingFileGenerator" as the default custom tool.

There is an ideal solution for removing a custom tool during the installation of NuGet by Subgurim user here: Properties of NuGet-T4 after installation are different

This will remove the Custom Tool attribute from the .TT files of my NuGet package. However, at the moment they are already executed, and my error list is full of errors when these files fail to execute.

Is there a way to clear the error list after successfully installing my NuGet package and / or stop Visual Studio from launching T4 templates during installation so that these errors do not get into the list?

+4
source share

All Articles