8

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)   
3
  • Apparently you defined a connection in a package that has the same name as the project CM. It can be in any package, not only the ones you intend using the project CM. Mar 8, 2013 at 18:56
  • I ran into this today. Moving the CM back to a package and then back to the project resolved it to where I could build.
    – John Mo
    Nov 22, 2013 at 15:29
  • @JohnMo Please add your helpful comment as an answer so that this question doesn't show up as unanswered to SO users. Feb 21, 2014 at 0:38

2 Answers 2

13

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.

1

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

1
  • This was the solution for me. Jun 18, 2019 at 0:45

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.