External configuration section appSettings?

Hello.

There asp.net mvc application whose web.config section appSettings specified external file file="CommonSettings.config". This file is in a separate library in the project web app added as a reference (on the link set the properties build action="Content" and Copy to Output Directory="Copy always").

If you run the app in debug, the CommonSettings.config is copied to the bin\Debug folder, but it is not in the root application folder (there where the Web.config).
How to get this file copied to the root of the application?
July 8th 19 at 15:56
1 answer
July 8th 19 at 15:58
Solution
Try the following:
  1. Open the Property of project
  2. Go to the tab Build Events
  3. In the Post-build event add the line
    copy $(SolutionDir)Projectname\CommonSettings.config $(ProjectDir)

Find more questions by tags .NETASP.NET