问题
I have a C# project and an App.Config file in this project. When i build the source code, a file (AssemblyName.exe.config) is created in the output directory for the application configuration but i want the name of this file App.Config. How can i do that?
回答1:
but i want the name of this file App.Config.
You can use a post-build event to rename the file.
However, realize that the application settings architecture which uses the file will expect the name to be AssemblyName.exe.config
. If you rename the file, the normal application settings architecture will break.
回答2:
You access in your Application Build
, in Event Post Build
add action who rename file.
rename "YourPath/AssemblyName.exe.config" "YourPath/App.Config"
来源:https://stackoverflow.com/questions/12333684/change-file-name-assemblyname-exe-config-to-app-config-for-output-directory