Visual Studio 2019 showing duplicate tests in Test Explorer - unit-testing

Duplicate Unit Tests started showing up for me in Visual Studio 2019, which I recently upgraded from 2017.
I’ve a side by side comparison of Visual Studio 2017 and 2019 below, which shows some test were duplicated and categorised under tests not run:
Cleaning the solution didn’t get rid of these tests and the only thing that did, was deleting the git repository and cloning it again.
Has anybody come across this issue and have a better solution that this sledge hammer approach?

I was talking to a colleague who also came across the same issue and he suggested another solution that worked for him.
Close Visual Studio.
Delete the ".vs" folder. You will find this folder where your solution (.sln) file exists.
Open Visual Studio.
This resolved the issue for him and is a less drastic measure that a delete and clone.

Related

The setup for this installation of visual studio is not complete, really?

I have been using Vs 2017 for several months on dev machine. This fine morning says setup incomplete. Am I missing something?
In this case you need to go to Control Panel => Programs and Features and choose Visual Studio and update it.
VS 2017 (15.6.6) was fine for me on Friday 6/1/18 on Windows 10, but same issue as OP today after a restart.
As suggested by the dialog and Retired Ninja, I ran the Visual Studio Installer (to 15.7.3 after updating VS Installer) and that fixed it.
Note that the 15.7.3 update was a 7.73 GB download. Your download size may vary.
This has happened to me for the last 3 upgrades in Visual Studio Enterprise 2017 (now again on upgrade to 15.9.21).
The fastest fix (and I'm not sure why) is simple and doesn't bomb your settings or take for ever.
In the Visual Studio Installer, click on Modify.
Click "Modify" on the bottom right corner.
Yes it says "Total space required 0 KB".
Yes you didn't really change anything.
It will then act like it is downloading something. (not sure what)
It will then act like it is installing something. (again, not sure what)
Open Visual Studio 2017 and it works.
Hope this helps.
If you have an offline installation like me and can't simply re-run the Visual Studio Installer you can edit devenv.isolation.ini and change the last line to read SetupFinished=true. It will detect your trickery and complain, but at least it will launch again.
Edit: I ended up getting the Visual Studio Installer to fix the issue after choosing the "Download then Install" option. Maybe I was too impatient when I initially stopped the update? My above answer is useful when you need to get work done that isn't affected by the broken features, but you will likely encounter problems later on.
just had the same problem (without any reason with) vs 2019 prof, after googling and reading on that topic, just went to vsix, looked for some individual component to install/uninstall, randomly picked cloud explorer, uninstalled it and some dependent components and VS 2019 prof started normally
decided to leave this here. may be it helps somebody
Solved: I did following steps, run the visual studio and it works for me.
In my case visual studio was working fine , I just restarted the PC, this popup was keep coming when I try to open visual studio.(in my case I was using VS 2019)
Go to this path "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE"
Open devenv.isolation.ini, set SetupFinished=true and save.
Now open visual studio.
Cheers!
In my case did following steps:
Clear temp files (you can %temp% in run command and Shift+Delete files)
Restart your computer
Open visual studio it will work properly.
Update: Faced problem again after couple of days, This time I go to C:\Program Files (x86)\Microsoft Visual Studio\Installer.
Click on retry.
Select one more feature which I had already installed on my Visual Studio
Click on modified and after installation it worked again.
This happened to me after I canceled a plugin update.
I solved by going to this site that has the latest update of Visual Studio.
https://learn.microsoft.com/en-us/visualstudio/releasenotes/vs2017-relnotes
I downloaded and upgraded it.
After that, Visual Studio worked.
If your VS is already upgraded, there´s an option to "repair" on the installer.
For this problem, goto uninstall screen in control panel right-click visual studio and select option change, Installer page will open now, In that window without changing anything click modify. it will solve the problem. I'm using VS Professional 2017
I got the same error today morning. This is what I did:
I ran the visual studio installer then I clicked on Modify.
The installer was showing 0KB Required. I continued and then it downloaded and installed. (Not sure what).
After that installation, it was able to launch.
I hope it works for you as well.
I was using Vs 2019 professional 16.6 and happened to me this issue one morning. I modified the installation by adding Azure Development tools even though I was not using it. This fixed the issue.
I just updated to 15.9.24 and I got this yet again, as I have my resolution above, and Visual Studio 2019 seems to be a lot better with avoid this issue. The installer for 2019 you do have to change something and do the modification, 2017 you don't have to change anything.
I reported this issue through Developer Community:
Setup not complete since 15.9.21
I don't know why but sometimes its buggy
it's up to date but after launch visual studio this error prompted !
you have to click modify in vs installer and just modify it.
its not going to download anything.
after a moment launch vs and enjoy :)
For VS2022, WIN11:
Control Panel > Programs > Programs and Features > Microsoft Visual Studio Installer
Then, click on Change and resume the previous process.

Visual Studio Test Explorer window not refreshing

Multiple times throughout the day, my Test Explorer window in Visual Studio 2017 is locking up. Whilst it doesn't crash VS, when affected I can't run any tests as none of the options are available when right clicking on a test....
I have a mixture of NUnit and SpecFlow+ tests in different projects. Cleaning and rebuilding the solution doesn't work, the test explorer window doesn't change. Attempting to use the 'NUnit test (click to run)' option also does nothing.
The only way to resolve this issue is to restart Visual Studio which is highly frustrating.
Anyone know what the issue could be?
Thanks
I was also facing the same issue, as a workaround I Unloaded my test project and then Reloaded back; then ran the test again. This time it refreshed the Test explorer :)
My VS version: VS Professional 2019 Version 16.9.6.
Note: I had to do this to all my Test projects.
I have had multiple issues with specflow+. In the end I uninstalled specflow+ and went with normal specflow. This solved many issues for me, including this issue. Hopefully it will work for you as well.

Resharper 'Ctrl Click' isn't working with visual studio 2017

Because of a Computer Change I recently had to install a fresh Visual Studio 2017 and the Resharper Ultimate Edition. After that, Ctrl-Click suddenly does no longer work as expected. Although the editor switches to "some" target, this target appears to be a bit "random".
Sometimes, though, it helps to simply step back with Ctrl-Minus to get to the desired target.
Any ideas?
I found the solution here. This also solved my Problem with a normal Ctrl-Click :)

Visual Studio 2017 Solution Explorer is empty

When I open an existing VS2015 solution file in VS2017, Solution Explorer is empty. I've tried to close and reopen Visual Studio several times, but the same thing happens every time. How to fix this?
This should fix it:
Close Visual Studio
Open Developer Command Prompt for VS 2017 (from Windows start menu)
Run devenv /updateconfiguration
Reopen Visual Studio
I'm experiencing the same issue. VS goes through all the steps when loading a solution, including "Preparing Solution", but then the Solution Explorer just comes up empty. So far I haven't found a solution. I tried deleting .suo files, and I tried cleaning the solution.
Like Eivind, I need to open the solution from the file menu. Fortunately, that has always worked for me so far.
Today's update for VS2017 fixed it for me. Also see https://developercommunity.visualstudio.com/content/problem/24529/solution-doesnt-open-in-vs-2017.html
I faced this type of issue when opening project on visual studio 2017.
If you have connected with TFS and I believed that your connection has been lost.
Re-connect and close the project and then reopen using visual studio.
Hope this will helpfull!
On the Notification Area there is a message for Visual Studio 2017 updates. Click on that and this fixed my problem of empty Solution Explorer when u click on a 2015 sln file.

Can I use visual studio unit test framework with Visual Studio Community?

For the life of me, I cannot figure out how to add Microsoft.VisualStudio.TestTools.UnitTesting to my project in Visual Studio 2013 Community version.
I tried adding it through nuget, which doesn't work -- I can only find Microsoft.VisualStudio.QualityTools.UnitTestingFramework, which seems to be different.
I tried adding it from C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies\ (as mentioned here Where to find "Microsoft.VisualStudio.TestTools.UnitTesting" missing dll?), but that directory doesn't exist for me.
I'm kind of at a loss now. Can I not use that with the community version of visual studio?
I had this today after uninstalling older VS products. I had VS2012 Express and VS2013 Professional installed, as well as using VS2015 Community Edition.
I'm afraid I don't have an explanation, but creating a new Unit Test project, recreating references and copying the code from the old Unit Test project has sorted out the issue. There must be something under the hood that changed.
I hope that helps someone else if they find themselves in the same boat!