Compiling transformation: The type 'Object' is defined in an assembly that is not referenced Compiling transformation: The type 'Object' is defined in an assembly that is not referenced typescript typescript

Compiling transformation: The type 'Object' is defined in an assembly that is not referenced


I can confirm that Portable class libraries in combination with T4 templates cause this problem in Visual Studio 2015 Update 2. I wasn't able to find better solution then retargeting TypeLITE to full .NET framework.

From the version 1.8.0 TypeLITE nuget package contains a copy of the library that targets full .NET framework. If your project targets full .NET framework, the correct TypeLITE assembly is picked up during installation and everything works fine in Visual Studio 2015 Update 2. Unfortunately if your project targets PCL, you are out of luck with Visual Studio 2015 Update 2. I am looking for better solution.


Thanks to Ian Yates for opening the Connect item.

Microsoft re-released KB3151378 on May 4, 2016. I can confirm that this update addresses the issue when T4 templates are used with EDMX files. Unfortunately I do not use TypeLite, so I am unable to confirm that it addresses the OP's issue, though I would suspect it does.

From the KB page:

Issue 6:

In T4 templates, errors occur when you reference an assembly that's built for a version of the .NET Framework that differs from the desktop (full) framework. For instance, errors occur when you reference portable libraries.


It looks like this should be fixed by KB3151378.

Notes for version 14.0.25130.0:

Issue 6

In T4 templates, errors occur when you reference an assembly that's built for a version of the .NET Framework that differs from the desktop (full) framework. For instance, errors occur when you reference portable libraries.