title: SSIS 2012 Project connection manager error
body: <p><strong>Basically</strong>:
  <BR />I have a project with 4 packages. All on them have different connection managers with the exception of one which is shared between 2 of the packages so I made it a project connection manager. </p>
  
  <ul>
  <li>If I try to build the project, I get the error below.</li>
  <li>If I change the project CM to a package CM, it builds fine</li>
  </ul>
  
  <p>So obviously the fact that I have a project CM is the problem. </p>
  
  <p><em>What can I be missing?</em> </p>
  
  <pre><code>Error   21  System.ArgumentException: An item with the same key has already been added.  
     at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)   
     at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)  
     at Microsoft.SqlServer.Dts.Runtime.ReferenceId.ReferenceMap.Add(String key, String value, Boolean isExternal)  
     at Microsoft.SqlServer.Dts.Runtime.ReferenceId.RefIdProducer.AddRefIdAttribute(XmlElement element, String objectName, String objectId, ReferenceParserState state)   
     at Microsoft.SqlServer.Dts.Runtime.ReferenceId.RefIdProducer.GenerateRefId(XmlElement element, ReferenceParserState state)    
     at Microsoft.SqlServer.Dts.Runtime.ReferenceId.RefIdProducer.ProcessElement(XmlElement element, ReferenceParserState state)    
     at Microsoft.SqlServer.Dts.Runtime.ReferenceId.RefIdConverter.MapRefIds(IDTSPackage100 package, IDTSInfoEvents100 events, XmlDocument document)    
     at Microsoft.SqlServer.Dts.Runtime.DTSManagedXmlSerializationHelper.AfterSavePackageToXML(IDTSPackage100 package, IDTSInfoEvents100 events, String&amp; packageXml)     
     at Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSPackagePersist100.ClonePackageToXML(Object&amp; pvDestination, Boolean vbReturnDOM, IDTSEvents100 pEvents)    
     at Microsoft.SqlServer.Dts.Runtime.Project.SavePackage(IProjectStorage storage, Package package, String streamName, Boolean preserveVersionGuid)    
     at Microsoft.SqlServer.Dts.Runtime.Project.SavePackage(Package package, String streamName, Boolean preserveVersionGuid)   
     at Microsoft.DataTransformationServices.Project.DataTransformationsProjectBuilder.IncrementalBuildThroughObj(IOutputWindow outputWindow)  
     at Microsoft.DataTransformationServices.Project.DataTransformationsProjectBuilder.BuildIncremental(IOutputWindow outputWindow)   
  </code></pre>