assembly with the same identity has already been imported

Dec 20, 2011 at 4:20 PM

All -- 

Please help.

In VS 2010, in C#, for my TT template I am getting the following error...

Error 1 Compiling transformation: An assembly with the same identity 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' has already been imported. Try removing one of the duplicate references. C:\Code\Team\Recruit4\Recruit4.BusinessLayer\Utilities\Generated\_T4CodeUtility03File.tt 1 1

...and I cannot seem to get rid of it.

Can you help?

Please advise.

Thanks.

-- Mark Kamoski

Dec 22, 2011 at 9:02 PM
Edited Dec 22, 2011 at 9:19 PM

 

All --

For anyone listening out there...

....I found a solution using absolute path referencing, as follows...

...I found references that I needed (for SMO), copied them out of the GAC, put them in a safe place, then used those locations in my references and here is what works now for me...

 

 

<#@ assembly name="C:\Code\SharedReferences\Microsoft.SqlServer.ConnectionInfo.dll" #>
<#@ assembly name="C:\Code\SharedReferences\Microsoft.SqlServer.Management.Sdk.Sfc.dll" #>
<#@ assembly name="C:\Code\SharedReferences\Microsoft.SqlServer.Smo.dll" #>
<#@ assembly name="System.Data" #>
<#@ import namespace="System" #>
<#@ import namespace="System.Data.SqlClient" #>
<#@ import namespace="System.Diagnostics" #>
<#@ import namespace="System.Collections" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.Collections.ObjectModel" #>
<#@ import namespace="System.Reflection" #>

 

 

...so I hope this helps.

(BTW, this is a cross-post duplicate that I made in another thread on this site because it turns out that 2 seemingly unrelated problems were solved by the same solution.)

 

Post Title: assembly with the same identity has already been imported

http://t4toolbox.codeplex.com/discussions/283625

 

Post Title: Error Compiling transformation Sfc.ISfcSupportsDesignMode


http://t4toolbox.codeplex.com/discussions/283641

Thanks and Merry Christmas!!!

-- Mark Kamoski