Reputation: 2983
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?
Upvotes: 0
Views: 75
Reputation: 693
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" />
Upvotes: 1