Visual Studio Test Project的一个小问题
笔者的VS2010的Test Project遇到了一样的问题.
错误信息例子:
An exception was encountered while constructing the content of this frame. This information is also logged by running the application with the /log parameter on the command line, which stores results in "C:\Users\sdavis\AppData\Roaming\Microsoft\VisualStudio\10.0\ActivityLog.xml".
Exception details:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: There is already a command handler for the menu command 'b85579aa-8be0-4c4f-a850-90902b317571 : 13074'.
at System.ComponentModel.Design.MenuCommandService.AddCommand(MenuCommand command)
at Microsoft.VisualStudio.TestTools.Vsip.CommandHelper.AddCommand(IMenuCommandService menuService, EventHandler invokeHandler, EventHandler statusHandler, CommandID id)
at Microsoft.VisualStudio.TestTools.TestCaseManagement.TestViewToolWindow.Initialize()
at Microsoft.VisualStudio.TestTools.TestCaseManagement.TestViewToolWindowHost..ctor()
--- End of inner exception stack trace ---
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at Microsoft.VisualStudio.Shell.Package.CreateToolWindow(Type toolWindowType, Int32 id, ProvideToolWindowAttribute tool)
at Microsoft.VisualStudio.Shell.Package.FindToolWindow(Type toolWindowType, Int32 id, Boolean create, ProvideToolWindowAttribute tool)
at Microsoft.VisualStudio.Shell.Package.Microsoft.VisualStudio.Shell.Interop.IVsToolWindowFactory.CreateToolWindow(Guid& toolWindowType, UInt32 id)
at Microsoft.VisualStudio.Platform.WindowManagement.WindowFrame.ConstructContent()
解决方案
====================
重启VS2010. –_-||
彻底解决方案
====================
1. Go to the Tools main menu -> Options… | Test Tools
2. Check the checkbox “Show all settings” to see the Test Tools settings
3. For the condition that reads “ When changes are made to the tests and background discovery of test methods is not enabled” (#9 from the top), choose “Don’t prompt”
参考资料
=====================
Test View return an exception
Test View Issue: An exception was encountered while constructing the content of this frame
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
2012-03-15 SharePoint Workflow的code运行在哪个进程? w3wp.exe 还是OWSTimer.exe?
2012-03-15 WinDBG脚本入门
2011-03-15 如果域控(domain controller)在防火墙内, 那么需要开放哪些端口才能让墙外的机器正常连接domain controller呢?
2010-03-15 记一次看DUMP的实战
2010-03-15 跨Farm的SSP的配置
2010-03-15 如何在x64的机器上使用WinDBG来debug一个32bit的.NET应用程序
2010-03-15 Deferred Symbol Loading