How do you fix Specflow “<unknown project>” issue in Visual Studio

家住魔仙堡 提交于 2020-01-16 13:10:13

问题


Background

I have been working on a project and noticed that one of my Specflow Scenarios needed updating.

I updated the Specflow Scenario by splitting it into two different scenarios (one for an invalid test and one for a valid test).

After this I then regenerated the feature.cs file, cleaned and rebuilt the solution.

(I am using Microsoft Visual Studio Enterprise 2019 Version 16.4.1)


Issue

This is when the "unknown project" appeared in my Test Explorer that consists of one test... the one I have changed. It cannot be run, however it cannot be removed either.

Here is what I am seeing: unknownprojectintestexplorer

The only way I have been able to get rid of this, for a brief period at least, is by deleting my entire solution and then pulling it back down again, which is less than ideal.

Here is a list of what I have tried to resolve this;

  • Updated all Nuget packages within the solution to the latest versions.
  • Restarted Test Explorer
  • Restarted Visual Studios
  • Deleted feature.cs files and regenerated
  • Cleaned and rebuilt solution
  • Updated Visual Studios (this seems to have made the situation appear more often)
  • Deleted the solution and pulled it back down (this works until I have to change an existing test and then restarted Visual Studios)

Has anyone seen this before, or know how to fix this?


回答1:


So after a day of trying to figure this out with my team we have finally resolved the issue.

The issue was caused by the cached (hidden) .vs file. When deleting this and restarting the solution the unknown project was gone.



来源:https://stackoverflow.com/questions/59545634/how-do-you-fix-specflow-unknown-project-issue-in-visual-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!