SSIS 2012 Project connection manager error

13,484

Solution 1

This occurs when you have the same connection manager twice (eg: copied between 2 packages) and you promote one of them to be a project connection.

The first package will show the connection manager of "(project) remoteSystem". The second package will still show "remoteSystem", and the new project level connection will not be shown.

If you delete the package level connection in the second package you will a) resolve the error, and b) the project level connection manager will become visible.

You will then have to go through all components that referenced the connection manager you deleted and re-direct them to the new project level connection.

Solution 2

Moving the CM back to a package and then back to the project resolved it to where I could build.

Share:
13,484
Diego
Author by

Diego

Senior Data Engineer - Big Data and Machine Learning

Updated on June 19, 2022

Comments

  • Diego
    Diego almost 2 years

    Basically:
    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.

    • If I try to build the project, I get the error below.
    • If I change the project CM to a package CM, it builds fine

    So obviously the fact that I have a project CM is the problem.

    What can I be missing?

    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& packageXml)     
       at Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSPackagePersist100.ClonePackageToXML(Object& 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)   
    
  • Geoff Dawdy
    Geoff Dawdy almost 5 years
    This was the solution for me.