I am trying to migrate my sln from xproj+project.json to csproj. I had on my project.json for my integration test project:
"buildOptions": {
"copyToOutput": {
"mappings": {
"appsettings.json": "../../src/WebApp/appsettings.json",
"appsettings.testing.json": "../../src/WebApp/appsettings.testing.json"
}
}
}
when I opened the .sln with visual studio 2017 it automatically converted to:
<ItemGroup>
<None Update="..\..\src\WebApp\appsettings.testing.json">
<Link>appsettings.testing.json</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="..\..\src\WebApp\appsettings.json">
<Link>appsettings.json</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
but now the integration tests stopped working since it not find the appsettings.json file. it throws:
Error Message: System.IO.FileNotFoundException : The configuration file 'appsettings.json' was not found and is not optional. The physical path is 'C:\Work\billing-app\test\IntegrationTests\bin\Debug\netcoreapp1.1\appsettings.json'.
how can I fix it so it'll continue to copy the real configuration file to the integration test project? 10x!