0

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

1 Answer 1

1

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" />

Sign up to request clarification or add additional context in comments.

1 Comment

No, it doesn't.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.