简体   繁体   English

如何将app.config添加到Visual Studio 2012 Web Express lib项目?

[英]How to add app.config to Visual Studio 2012 Web Express lib project?

How can I add a configuration file to Visual Studio 2012 Web Express library project? 如何将配置文件添加到Visual Studio 2012 Web Express库项目?

I tried following the msdn instructions but I just don't have the Application Configuration File template. 我尝试遵循msdn说明,但我没有Application Configuration File模板。 I tried looking all over in the properties of the project to specify the config file, but it's nowhere to be found. 我试着在项目的属性中查找指定配置文件,但它无处可寻。

Any ideas? 有任何想法吗?

Libraries don't generally have configuration files. 通常没有配置文件。 When an application loads, the configuration it loads will be the one associated with that application - not the libraries within it. 加载应用程序时,它加载的配置将是与该应用程序关联的配置 - 而不是其中的库。

You can create app config files for libraries, and load them explicitly - but it's a bit of a pain. 可以为库创建应用程序配置文件,并明确加载它们 - 但这有点痛苦。 Consider exposing configuration directly in your API, and allowing the application consuming the library to provide the configuration appropriately. 考虑直接在API中公开配置,并允许使用库的应用程序适当地提供配置。

在ASP.NET中,它被称为“Web应用程序文件”,该文件名称为“web.config”。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 Visual Studio Web 2013 中添加 app.config 或 web.config 文件? - How can I add an app.config or web.config file in Visual Studio Web 2013? 如何在Web项目解决方案visual studio中的单独项目中部署app.config - How to deploy app.config in separate project within a web project solution visual studio Visual Studio 2012测试项目正在从machine.config而非从app.config加载配置设置 - visual studio 2012 test project is loading configuration settings from machine.config but not from app.config 配置(app.config或web.config)在Visual Studio 2012中未显示智能感知 - configuration(app.config or web.config) is not showing intellisense in visual studio 2012 如何在Visual Studio Code中添加App.Config? - How to add an App.Config in Visual Studio Code? Visual Studio:项目中的“ App.config”的自定义名称,而不是项目外部的自定义名称? - Visual Studio: Custom name for “App.config” in project, not outside project? 在 Visual Studio for mac 中为控制台应用程序添加 app.config 文件 - Add app.config file for console application in Visual studio for mac 如何在不同的解决方案之间共享相同的 Visual Studio 项目? 不同的 app.config 和 settings.settings - How to share same Visual Studio project between different solutions? Different app.config and setttings.settings 带有EDMX的Visual Studio 2012 Web Express编译项目 - Visual Studio 2012 Web Express Compile Project with EDMX Visual Studio:如何在 exe 中嵌入 app.config? - Visual Studio : how to embed app.config in the exe?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM