Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS Test Explorer reports 'testhost not found' errors #429

Closed
idg10 opened this issue Jan 18, 2024 · 1 comment · Fixed by #430
Closed

VS Test Explorer reports 'testhost not found' errors #429

idg10 opened this issue Jan 18, 2024 · 1 comment · Fixed by #430

Comments

@idg10
Copy link
Contributor

idg10 commented Jan 18, 2024

This seems to be the same problem described in microsoft/vstest#4469

Essentially, either using "Test" in a project name or just referencing nunit is enough to make bits of the build system think your project is a test project. And when it isn't really a test project, the VS Test Explorer throws up.

You have to explicitly annotate projects as not being test projects. And apparently you have to do that in three different ways:

  1. Set the IsTestProject build property to false
  2. Set the TestProject build property to false
  3. Remove the TestContainer ProjectCapability that nUnit apparently adds.

See microsoft/vstest#4469 (comment)

Apparently the VS Test team aren't planning to improve Test Explorer's handling of this at all. The official solution is that it's our job to understand why this really confusing error occurs and apply these changes to our project files microsoft/vstest#4469 (comment)

@PondPackMan2023
Copy link

It's unclear in this thread if this issue is fixed. I am on Visual Studio 2022 17.9.5 and I'm referencing 17.9 of the Test.Sdk and I still run into this issue. Yes, I am using NUnit for test projects. I even tried using the "workaround" by specifying false for IsTestProject and TestProject and the ProjectCapability remove option (all three) for non-Test projects, and I still run into the issue.

This is very frustrating. Running tests in Test Explorer targeting net48 works just fine. It's only net6 targeted projects that have difficulty.

If this issue is fixed, what release is expected to have it available?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants