Skip to content

testhost.deps.json missing #35917

@roberttekaat-ireckonu

Description

@roberttekaat-ireckonu

Description

Just started setting up an integration tests for my web project. I'm only checking if the health endpoint is returning a 200 OK, but I get this error:

System.InvalidOperationException : Can't find '\bin\Debug\net8.0\testhost.deps.json'. This file is required for functional tests to run properly. There should be a copy of the file on your source project bin folder. If that is not the case, make sure that the property PreserveCompilationContext is set to true on your project file. E.g 'true'. For functional tests to work they need to either run from the build output folder or the testhost.deps.json file from your application's output directory must be copied to the folder where the tests are running on. A common cause for this error is having shadow copying enabled when the tests run.

Adding that setting did nothing btw, but this file is not mentioned in the documentation so I'm clueless now. And I just started 5 min ago, already stuck. This is a very bad way of starting a new subject.

Edit: reason for my issue is mentioned here: https://stackoverflow.com/a/71165490/27733955

Page URL

https://learn.microsoft.com/en-us/aspnet/core/test/integration-tests?view=aspnetcore-9.0

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/test/integration-tests.md

Document ID

f499b131-8b14-7e10-1728-543fdd5a5656

Platform Id

a725fe2a-b11f-6664-eb77-2adc94d55792

Article author

@tdykstra

Metadata

  • ID: 77889d43-fedb-f8b4-8fea-379ec946555c
  • PlatformId: a725fe2a-b11f-6664-eb77-2adc94d55792
  • Service: aspnet-core
  • Sub-service: testing

Related Issues

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions