© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
9 replies
jjthomps

❔ T4 Compiling transformation error

Hi,
I'm upgrading a solution to .net 7.0. One of the projects contains T4 transformation templates. Getting the following error even though the target framework is set to net7.0 for all projects contained within the solution.

Compiling transformation: The type 'List<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Collections, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

I have updated the tarhet sdk to net7.0 in all the projects, updated sdk version in the global.json files, deleted the vs, bin and obj directories, cleaned the solution, reopened solution, rebuilt solution, upgrade Visual Studio 2022 to the latest version but there is still an issue

when I try to add a reference to system.Collections an error is displayed saying that the dll is invalid or not supported

anyone got any ideas what's wrong?

Thanks
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Re-compiling error
C#CC# / help
3y ago
Error while compiling dotnet runtime
C#CC# / help
4y ago
T4 templates in Entity Framework
C#CC# / help
3mo ago
Rotational matrix transformation
C#CC# / help
4y ago