I have an ASP.NET Core 2 web application. Whenever I try to deploy the application, Visual studio replaces appsettings.json and Web.config which causes problem to the application. Is there a way to inform Visual Studio that I do not want to deploy these two files?
1 Answer
Add a new ItemGroup section in the .csproj file.
For instance the following block would ensure both variants of appsettings.json are not copied to publish folder.
<ItemGroup>
<Content Update="appsettings.Development.json" CopyToPublishDirectory="Never" />
<Content Update="appsettings.json" CopyToPublishDirectory="Never" />
1 Comment
Sawrub
No, it doesn't.