Visual Studio 2022 17.6.2
EDIT: The relevant solution is entirely Desktop. WPF, console, and class library projects are included, but Internet and Web capabilities are not relevant.
I have several unit tests which formerly worked fine. Yesterday I noticed they were displayed in the Test Explorer but would not run. On build, a button in Test Explorer labelled "X Warnings" (where X is how many projects are in my solution) would link to the "Tests" output claiming that every project has no tests found in it:
No test is available in [].dll. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
In Test>Options, I unchecked "Discover tests in real time from C# and Visual Basic .NET source files". This made the tests stop appearing in Test Explorer. Test Explorer was still showing a count of warnings, but I think at this point it became 1. "Tests" output still listed the same message for every project.
Per this answer I reinstalled the 3 relevant NuGet packages I had. This made the count of warnings drop to 0, but the "Tests" output still showed the same message for every project. I added the Microsoft.TestPlatform.ObjectModel package and saw no effect from it.
I tried running the tests on the command line:
mstest /testcontainer:"[].dll" /nologo
Loading [].dll...
TestTypes\37e36796-fb51-4610-8d5c-e00ceaa68b9f could not be loaded because the TIP could not be instantiated for the following reason(s): System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.Tips.WebLoadTest.Tip, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.VisualStudio.QualityTools.Tips.WebLoadTest.Tip, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.Type.GetType(String typeName, Boolean throwOnError)
at Microsoft.VisualStudio.TestTools.TestManagement.TipDelayLoader.LoadTip()
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
Starting execution...
No tests to execute.
This generates a message in the Event Viewer:
The description for Event ID 0 from source VSTTExecution cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event:
(mstest, PID 15624, Thread 1) HKEY_LOCAL_MACHINE\EnterpriseTools\QualityTools\TestTypes Key cannot be found!
The message resource is present but the message was not found in the message table
This does give me pass/fail results:
vstest.console.exe "[].dll"
Why is Test Explorer failing to find tests? Is the Event Viewer message important, or should I ignore it?
Install the following feature from Visual Studio Installer >> Individual components.
"Web performance and load testing tools"
I was using VS 17.6.3 Enterprise and it solved the issue.
As per this VS thread web performance and load testing tool its available only in Visual Studio Enterprise