测试浏览器(VS)显示“<未知项目" [英] Test Explorer (VS) shows '<Unknown project>'
问题描述
下面的所有内容都是使用.NET Framework 4.7和NUnit + NUnit3TestAdapter在VS2019中制作的
Everthing below is made in VS2019, using .NET Framework 4.7 and NUnit + NUnit3TestAdapter
我创建了一个名为Exitus.Tests的程序集,并添加了一些单元测试.但是,针对Nuget无法解决的一些问题,我创建了另一个名为Exitus.UnitTests的项目,并删除了旧项目中包含的一次文件(包括更改名称空间).
I created an assembly called Exitus.Tests, and added a few unit tests. However, do to some issues with Nuget, that I could not solve, I made another project called Exitus.UnitTests and removed the once file I had in the old project (including changing the namespace).
现在,新的测试项目在资源管理器中正确显示了op,但是旧项目的幽灵"仍然存在:
Now the new test project showed op correctly in the explorer, but a "ghost" of the old project remained:
如果我尝试运行测试,则输出窗口将显示以下错误:
If I try to run the test, the output window shows the following error:
System.InvalidOperationException:找不到以下TestContainer'C:\ Users \ xxx \ Source \ Repositories \ Expire \ Exitus.Tests \ bin \ Debug \ Exitus.Tests.dll' 在Microsoft.VisualStudio.TestWindow.Client.TestContainer.TestContainerProvider.d__46.MoveNext() ---从上一个引发异常的位置开始的堆栈结束跟踪--- 在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务) 在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务任务) 在Microsoft.VisualStudio.TestWindow.Controller.TestContainerConfigurationQueryByTestsBase.d__6.MoveNext() (...)
System.InvalidOperationException: The following TestContainer was not found 'C:\Users\xxx\Source\Repositories\Expire\Exitus.Tests\bin\Debug\Exitus.Tests.dll' at Microsoft.VisualStudio.TestWindow.Client.TestContainer.TestContainerProvider.d__46.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.TestWindow.Controller.TestContainerConfigurationQueryByTestsBase.d__6.MoveNext() (...)
堆栈跟踪的时间要长得多,但是奇怪的是第二行,指出它无法在\Exitus.Tests\bin\Debug\Exitus.Tests.dll
处找到测试容器.这是旧测试项目的名称,我已删除并删除了该项目.我已经在整个项目中搜索了Exitus.Tests
一词,但未返回任何结果.
The stack trace is a lot longer, but the curious thing is the second line, stating that it could not find the test container at \Exitus.Tests\bin\Debug\Exitus.Tests.dll
. This is the name of the old test project, which I removed and deleted. I have searched my entire project for the term Exitus.Tests
and it returns no results.
总有办法强行删除此鬼"项目吗?
Is there anyway to forcefully remove this 'ghost' project?
推荐答案
- 关闭 Visual Studio .
- 将
*.testlog
文件删除: solutionfolder \.vs \ 解决方案名称 \ v16 \ TestStore \ 编号.
- Close Visual Studio.
- Delete the
*.testlog
files in: solutionfolder\.vs\solution name\v16\TestStore\number.
这篇关于测试浏览器(VS)显示“<未知项目"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!