Developer
Developer

Reputation: 457

"Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources" not found when debugging tests in Rider

When I am debugging unit tests in Rider, I am getting a COMException:

System.Runtime.InteropServices.COMException (0x80070490): Element not found. (Exception from HRESULT: 0x80070490)
   at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities.VSInstallationUtilities.ISetupConfiguration.GetInstanceForCurrentProcess()
   at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities.VSInstallationUtilities.get_VSInstallPath()

This is followed by a FileNotFoundException:

Could not load file or assembly
'Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources, Version=14.0.0.0, Culture=en-US, PublicKeyToken=b03f5f7f11d50a3a' 
or one of its dependencies. The system cannot find the file specified.

The exceptions seem to be handled, so the test can keep running. It is just that Rider breaks on these exceptions, and it is annoying to have to keep pressing F5. When the tests are run without debugging, they run until completion without problems.

Of course, I could disable breaking on these types of exceptions in Rider, but I would like to solve the underlying problem, if possible.

I have installed the NuGet package in my test projects:

<PackageReference Include="Microsoft.VisualStudio.TestPlatform" Version="14.0.0" />

and I see the relevant .dll files in the bin folder, but I do not know how to get the .resources file.

This started happening in the last month, and I do not understand the reason. Possibly it may be related to the latest Rider update.

Here is a question about the same file not being found, and the questions has not been answered for 5 years, so my hopes are not high, but I thought I would try: "Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources" not found

Upvotes: 0

Views: 46

Answers (0)

Related Questions