CarterCommunity / Carter

Carter is framework that is a thin layer of extension methods and functionality over ASP.NET Core allowing code to be more explicit and most importantly more enjoyable.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't find testhost.deps.json

Programazing opened this issue · comments

I tried adding Carter to a larger app over the weekend, and I kept running into the error:

Can't find 'CarterMinApi-Temp/WebApplication1.Tests/bin/Debug/net8.0/testhost.deps.json'.

After spending a few hours trying to resolve the issue by searching and using ChatGPT, I decided to make a small test project to see if it was something in my larger project; I ended up with the same error.

I uploaded that small project to GitHub in hopes of having someone take a look at it. I'm hoping I just implemented something incorrectly.

https://github.com/Programazing/CarterMinApi-Temp

It turns out it was an issue with WebApplicationFactory.

WebApplicationFactory<Program> wasn't referencing Program.cs.

I'll take the demo repo down, but if anyone shows up here looking for an answer, check out the link below.

https://stackoverflow.com/questions/69991983/deps-file-missing-for-dotnet-6-integration-tests