I get this error from SQLPackage: "An item with the same key has already been added" What is the meaning? Google won't help me..
"c:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin\sqlpackage.exe" /Action:DeployReport /SourceFile:"XXX.dacpac" /Profile:"publish.xml" OutputPath:"Report.xml"
Generating report for database 'XXX' on server 'srv'.
* An item with the same key has already been added.
No output file is created.
Generate script from Visual Studio works (I get a script). I have tested with three projects in the same solution. Only one creates a DeploymentReport-file.
Publish works.
Your item with the same key has already been added is also an utra general error, but typically it can be trying to set the same key in a database (or forgetting to set a key with no default value, hence for instance if an int, then all rows would be 0, de default) or a dictionary.
SqlPackage.exe is a command-line utility that automates the following database development tasks by exposing some of the public Data-Tier Application Framework (DacFx) APIs: Version: Returns the build number of the SqlPackage application.
I just ran into this issue. For anyone else who gets this, try the following.
I believe it is related to a cache of the dependancies becoming corrupt.
I was having the same issue. The weird thing was I could publish from Visual Studio without a problem, but as soon as I tried to publish from the command-line using SqlPackage I got this error.
For me it turned out that there were duplicate SqlCmdVariable's in my *.publish.xml file. I removed the duplicates and now publish without a problem from the command-line.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With