gpt4 book ai didi

c# - 在 bin 目录中找不到 AppConfig 文件

转载 作者:可可西里 更新时间:2023-11-01 08:03:09 24 4
gpt4 key购买 nike

我有一个 App.Config 文件,用户可以访问该文件并设置一些设置来运行该程序。但是当我去我的程序的 bin\release 文件夹复制并给他们 exe、DLL 等时,我找不到 App.Config 文件。我应该怎么办?它是一个 ConsoleApp。

最佳答案

您的 App.Config 将被转换为 ApplicationName.exe.config

因此,如果您的应用程序名称是 SampleApplication.exe,那么您需要检查以下文件名

SampleApplication.exe.config

来自 MSDN:App.Config

When you develop in Visual Studio, place the source configuration file for your app in the project directory and set its Copy To Output Directory property to Copy always or Copy if newer. The name of the configuration file is the name of the app with a .config extension. For example, an app called myApp.exe should have a source configuration file called myApp.exe.config.

关于c# - 在 bin 目录中找不到 AppConfig 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23296098/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com