I am following this guide. I have a Startup
in the API project that uses an appsettings.json
configuration file.
public class Startu
In the end, I followed this guide, specifically the Integration Testing section towards the bottom of the page. This removes the need to copy the appsettings.json
file to the output directory. Instead it tells the test project the actual directory of the web application.
As for copying the appsettings.json
to the output directory, I also managed to get that to work. Combined with the answer from dudu, I used include
instead of includeFiles
so the resulting section would look something like this:
"buildOptions": {
"copyToOutput": {
"include": "appsettings.json"
}
}
I'm not entirely sure why this works but it does. I had a quick look at the documentation but couldn't find any real differences and since the original problem was essentially solved I didn't look further.