gpt4 book ai didi

c# - 为什么程序集似乎被引用但实际上没有

转载 作者:太空宇宙 更新时间:2023-11-03 21:28:59 25 4
gpt4 key购买 nike

我正在从事 ASP.Net MVC 项目。我在访问 System.Configuration.Configuration 类时遇到问题。它说它不存在,尽管我可以引用 System.Configuration。

问题是我没有在项目中添加对 System.Configuration 程序集的引用。

谁能告诉我为什么智能感知仍然找到 System.Configuration 类。它是另一个默认程序集的一部分吗?

谢谢,

最佳答案

System.Configuration 是一个命名空间,而不是一个类。

System.Configuration 命名空间的某些类在 System.dll 程序集和 System.Configuration.dll 中定义。

例如 ConfigurationManager 是 System.Configuration.dll 的一部分

http://msdn.microsoft.com/en-us/library/system.configuration.configurationmanager(v=vs.110).aspx

而 UriSection 是 System.dll 的一部分

关于c# - 为什么程序集似乎被引用但实际上没有,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25224639/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com