简体   繁体   English

c#:bin \\ debug文件夹中的配置文件

[英]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 alwaysCopy always ,如果将其设置为Do not copyDo 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.

相关问题 c#如何将xml文件保存在与app / bin / debug /不同的文件夹中 - c# how to save an xml file in a different folder than app/bin/debug/ IronRuby,如何从常规C#项目目录而不是bin \\ debug文件夹执行ruby文件? - IronRuby, How make ruby file executed from the regular C# project directory rather than bin\debug folder? .config文件未复制到bin \\ config文件夹 - .config file not copied to bin\config folder 在c#中创建一个xml文档,并将该文件存储到项目的bin文件夹中 - create an xml document in c# and store that file into bin folder of the project 我的程序需要使用位于 Debug 文件夹中的第三方软件,但程序显示找不到配置文件。 C# - My program needs to use a third-party software located in the Debug folder, but the program says no config file was found. C# 发布后,配置文件出现在bin文件夹中 - Config file is appearing in bin folder after publishing 如何将Bin文件夹中的配置文件设置为非人类可读格式?(C#) - How to make config files in Bin folder into non human-readable formats?(c#) 在C#WPF调试文件夹中导入.exe文件并执行 - Import .exe file in C# WPF debug folder and execute it 移动MVC C#项目的bin文件夹 - Move bin folder of MVC C# project C#:. Config文件并在程序文件夹中写入问题 - C#: .Config File and write issue in program folder
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM