asp.net - DLL appsettings 返回 null(查看 web.config 而不是 DLL app.config)

标签 asp.net web-config app-config

我们有一个 DLL,它有自己的应用程序设置。现在,如果我在 ASP .Net 网站中使用 dll,ConfigurationManager.AppSettings[key] 将查看网站的 web.config,而不是 DLL 的 App.config。

是否可以在 DLL 的 app.config 而不是网站的 web.config 中获取配置设置?

非常感谢任何帮助。

谢谢

拉贾

最佳答案

DLL 不能有自己的配置。

库在应用程序(Web 或其他)的上下文中执行 - 配置是该应用程序的配置。

关于asp.net - DLL appsettings 返回 null(查看 web.config 而不是 DLL app.config),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6983592/

相关文章:

asp.net - 将子域重定向到azure web应用程序中的子文件夹

c# - DLL 的 app.config 中的 ConnectionString 为空

c# - .Net Core 3.0 可执行文件不读取 appsettings.json

c# - 如何在 C# Winforms 的 app.config 中保存配置

asp.net - 将外部DLL加载到WinDBG

c# - ASP.NET WebAPI - 如何扫描注册的操作

c# - 从 WCF 中的 web.config 获取 Sitecore "Site"数据

javascript - 我可以永久更改 html 按钮的值和标签吗?

asp.net - 如何将网站部署到互联网。(ASP.NET 和 SQL Server )

asp.net - 允许其他人使用 iframe 我的网站