Change file name <AssemblyName.exe.config> to <App.Config> for output directory in Visual Studio

╄→гoц情女王★ 提交于 2019-12-11 01:46:36

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!