Visual Studio 2015 WPF 设计器未加载声明 System.ArgumentException 已添加

本文关键字:声明 加载 System ArgumentException 添加 2015 Studio WPF Visual | 更新日期: 2023-09-27 18:32:03

有人可以帮我在尝试创建我的 WPF 解决方案时不断收到此错误吗,我需要能够使用我的 deigner 进行学习感谢堆。

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 System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
at Microsoft.VisualStudio.DesignTools.Utility.Telemetry.VsTelemetryService.RegisterDesignerProcessSession(Int32 pid)
at Microsoft.VisualStudio.DesignTools.Utility.Feedback.WatsonTracker.RegisterSession(Int32 processID)
at Microsoft.VisualStudio.DesignTools.Utility.DesignerSessionTracker.RecordDesignerStart(Int32 processID, String isolationTargetIdentifier, Boolean mockCustomTypes, String buildConfiguration)
at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Primitives.ProcessDomainFactory.ProcessIsolationDomain..ctor(ProcessDomainFactory factory, IIsolationBoundary boundary, AppDomainSetup appDomainInfo, IIsolationTarget isolationTarget, String baseDirectory)
at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Primitives.ProcessDomainFactory.CreateIsolationDomain(IIsolationBoundary boundary)
at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Primitives.IsolationBoundary.Initialize()
at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Primitives.IsolationBoundary.CreateInstance[T](Type type)
at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.IsolatedObjectFactory.Initialize()
at Microsoft.VisualStudio.DesignTools.DesignerHost.Services.VSIsolationService.CreateObjectFactory(IIsolationTarget isolationTarget, IObjectCatalog catalog)
at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.IsolationService.CreateLease(IIsolationTarget isolationTarget)
at Microsoft.VisualStudio.DesignTools.DesignerContract.IsolatedDesignerService.CreateLease(IIsolationTarget isolationTarget, CancellationToken cancelToken, DesignerServiceEntry& entry, IServiceProvider serviceOverrides)
at Microsoft.VisualStudio.DesignTools.DesignerContract.IsolatedDesignerService.IsolatedDesignerView.CreateDesignerViewInfo(CancellationToken cancelToken)
at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.IsolatedTaskScheduler.InvokeWithCulture[T](CultureInfo culture, Func`2 func, CancellationToken cancelToken)
at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.IsolatedTaskScheduler.<>c__DisplayClass10_0`1.<StartTask>b__0()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()

Visual Studio 2015 WPF 设计器未加载声明 System.ArgumentException 已添加

将目标更改为 x86 并重新编译,然后关闭窗口并重新打开,设计器应该可以工作。确保您的 x86 平台具有正确的值来面向 x86...

这似乎是 x64 的问题。所以我们在 x86 下构建,然后翻转并测试 x64。很烦人,但至少你可以让设计师工作。