C# app.config configSections 自定义设置找不到架构信息
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/229155/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
app.config configSections custom settings can not find schema information
提问by Jon
I am just learning about app.config in respect of creating custom sections. I have that part working, it compiles and gets the information out as required but I get warnings about it could not find the schema information.
我只是在创建自定义部分方面了解 app.config。我让那部分工作,它根据需要编译并获取信息,但我收到关于它找不到架构信息的警告。
I have done a bit of googling and could not find a simple explanation of this situation.
我做了一些谷歌搜索,找不到这种情况的简单解释。
The approach (that seems to make sense to me at the moment) would be to have a schema file for each section within that project. I understand how to create a schema file, but do not know how I would like this into the project.
方法(目前对我来说似乎很有意义)是为该项目中的每个部分都有一个架构文件。我了解如何创建架构文件,但不知道我想如何将其导入到项目中。
Also when it is compiled and deployed to another machine I presume that schema file would need to be copied across as well.
此外,当它被编译并部署到另一台机器时,我认为也需要复制模式文件。
Thanks for any and all help
感谢您的任何帮助
Jon
乔恩
采纳答案by Pablo Retyk
Try linking the app.config file to the corresponding schema (ussually you can find it on C:\Program Files\Microsoft Visual Studio 8\xml\Schemas\DotNetConfig.xsd) ,to do so just open the app.config file in visual studio, open the properties window (F4) and put the path above to schemas. Pablo.
尝试将 app.config 文件链接到相应的架构(通常您可以在 C:\Program Files\Microsoft Visual Studio 8\xml\Schemas\DotNetConfig.xsd 上找到它),为此只需在可视化中打开 app.config 文件工作室,打开属性窗口(F4)并将上面的路径放在schemas。巴勃罗。