dotnet / dotnet/AspNetCore.Docs

testhost.deps.json missing

Open
#35,917 3 comments 0 reactions 1 assignee Claimed by @tdykstra View on GitHub
aspnet-core/svc Source - Docs.ms testing/subsvc
Dominant language
C#
Stars
13.1k
Forks
24.6k
Avg merge
1d 2h
Merged PRs (30d)
109

Description

### 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](https://github.com/dotnet/AspNetCore.Docs/issues?q=is%3Aissue+is%3Aopen+f499b131-8b14-7e10-1728-543fdd5a5656)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.