[英]c#: config file in bin\debug folder
I kept getting errors in my log file that messageconfig file not found. 我的日志文件中一直收到错误,找不到messageconfig文件。 It turned out that my application was expecting it in the bin\\debug folder.
事实证明我的应用程序期望它在bin \\ debug文件夹中。 What causes the application to expect so?
是什么导致应用程序期望如此? It seems that when project is built it should copy the config file in bin\\debug folder.
似乎在构建项目时,它应该复制bin \\ debug文件夹中的配置文件。 Am i missing a certain project setting?
我错过了某个项目设置吗?
App/web.Config files are expected to be in the same directory as the application/web root. App / web.Config文件应与应用程序/ Web根目录位于同一目录中。
Other, referenced config files may be in other directories, as specified in the main configuration file. 其他引用的配置文件可能位于其他目录中,如主配置文件中所指定。
If you right click on the .config
file, then on properties
there is a Copy to Ouput Directory
entry. 如果右键单击
.config
文件,则在properties
有一个Copy to Ouput Directory
条目。
This should be set to either Copy if Newer
or Copy always
, if this is set to Do not copy
, the .config
will not by copied to the debug/release folder where it is expected. 这应设置为“
Copy if Newer
Copy always
或Copy always
,如果将其设置为Do not copy
, Do not copy
会将.config
复制到预期的调试/发布文件夹中。
Config files are expected to be in the same location as the executing assembly. 配置文件应与执行程序集位于同一位置。
Check out this SO question: .NET 2.0 Application Settings (user.config) file location 看看这个问题: .NET 2.0应用程序设置(user.config)文件位置
您可以将文件构建操作设置为“始终复制”..
usually you only need the .exe. 通常你只需要.exe。 Try to clean and rebuild your project..
尝试清理并重建您的项目..
Hope it helps 希望能帮助到你
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.