简体   繁体   中英

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?

I tried following the msdn instructions but I just don't have the Application Configuration File template. 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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM