Error compiling transformation

May 24, 2010 at 10:42 AM

Hi,

I'm obtaining this error:

Compiling transformation: The type 'T4Toolbox.Generator' exists in both 'c:\Windows\assembly\GAC_32\T4Toolbox\10.3.7.1__7e313accbcce84dc\T4Toolbox.dll' and 'c:\Windows\Microsoft.NET\assembly\GAC_32\T4Toolbox.10.0\v4.0_10.3.7.1__7e313accbcce84dc\T4Toolbox.10.0.dll'

I converted the VS2008 project in VS2010 and I installed the last version of T4 Toolbox.

Some one has any idea?

Thanks   

 

Coordinator
May 24, 2010 at 1:26 PM

It appears that your template somehow references both 3.5 and 4.0 versions of the T4Toolbox assembly. Do you by any chance have an explicit <#@ assembly #> reference to T4Toolbox?

Oleg

May 24, 2010 at 1:46 PM

I delete <#@ assembly name="T4Toolbox" #> from T4ToolBox.tt and now it works, why?

How can I specific the framework version?

Thanks

Coordinator
May 24, 2010 at 2:44 PM

T4Toolbox assembly has two different binaries, one for Visual Studio 2008 (T4Toolbox.dll) and one for Visual Studio 2010 (T4Toolbox.10.0.dll). This is necessary because the Microsoft assemblies it references also have separate binaries for .NET framework 3.5 and 4.0. You should not reference T4Toolbox assembly explicitly in your template. Instead, include T4Toolbox.tt file, which will reference the correct version of the assembly automatically.

Oleg