无法更改架构比较

时间:2018-03-13 09:57:07

标签: .net visual-studio-2017 database-schema

当我尝试在架构比较中选择目标(或选择源)时,我收到Microsoft .NET Framework错误:“System.ArgumentException:已添加具有相同键的项目。”如果我使用保存的模式比较或创建新模式并不重要。这只是我的一个解决方案中的问题,当我们从TFS / TFVC转移到VSTS / Git时,通过将多个项目合并到一个解决方案中来创建一个问题。完整的错误是:

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
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.VisualStudio.Data.Tools.Package.SchemaCompare2.UI.SchemaCompareConnectionDialog.PopulateProjectCombos()
   at Microsoft.VisualStudio.Data.Tools.Package.SchemaCompare2.UI.SchemaCompareConnectionDialog..ctor(Boolean isSource, ISchemaCompareParticipant participant)
   at Microsoft.VisualStudio.Data.Tools.Package.SchemaCompare2.UI.SchemaCompareSourceTargetControl.CollectFromConnectionDialog(Boolean isSource)
   at Microsoft.VisualStudio.Data.Tools.Package.SchemaCompare2.UI.SchemaCompareSourceTargetControl.<>c__DisplayClass29_0.<SetupComboBox>b__0(IImageComboBoxItem i)
   at Microsoft.VisualStudio.Data.Tools.Package.SchemaCompare2.UI.SchemaCompareSourceTargetControl.OnSelectionChangeCommitted(Object sender, EventArgs e)
   at System.Windows.Forms.ComboBox.OnSelectionChangeCommitted(EventArgs e)
   at System.Windows.Forms.ComboBox.OnSelectionChangeCommittedInternal(EventArgs e)
   at System.Windows.Forms.ComboBox.WmReflectCommand(Message& m)
   at System.Windows.Forms.ComboBox.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

1 个答案:

答案 0 :(得分:0)

问题结果是,当我合并项目时,有两个名为&#34; Database&#34;添加。我重命名了一个,问题就消失了。