Visual Studio 2015 WPF 设计器未加载说明 System.ArgumentException 已添加具有相同键的项目 [英] visual studio 2015 WPF designer not loading stating System.ArgumentException An item with the same key has already been added

查看:24
本文介绍了Visual Studio 2015 WPF 设计器未加载说明 System.ArgumentException 已添加具有相同键的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

can someone please help me keep getting this error when trying to create my WPF solution and I need to beable to use my deigner for my studies thanks heaps.

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()

推荐答案

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

Change your target to x86 and recompile then close the window and reopen and the designer should work. Ensure your x86 platform has the correct values to target x86...

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

It appears to be an issue with x64. So we build under x86 and then flip and test x64. Annoying but at least you can get the designer to work.

这篇关于Visual Studio 2015 WPF 设计器未加载说明 System.ArgumentException 已添加具有相同键的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆