System.DirectoryServices在名称空间"System"中无法识别 [英] System.DirectoryServices is not recognised in the namespace 'System'
问题描述
我正在尝试在网站项目中使用 System.DirectoryServices
,但出现此错误:
I'm trying to use System.DirectoryServices
in a web site project and I'm getting this error:
名称空间系统"中不存在类型或名称空间名称"DirectoryServices"(您是否缺少程序集引用?)
The type or namespace name 'DirectoryServices' does not exist in the namespace 'System' (are you missing an assembly reference?)
我的项目在 web.config
中对 System.DirectoryServices
的引用:
My project has a reference to System.DirectoryServices
in web.config
:
<add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
我确实要在要使用它的文件中使用System.DirectoryServices .
And I do have using System.DirectoryServices
in the files where I want to use it.
有人知道在哪里寻找问题吗?
Does anybody have a clue where to look for the problem?
推荐答案
是否已将Web服务器(IIS或其他)配置为将文件夹作为应用程序运行(即显示为齿轮),并且使用的是正确的版本ASP.NET?如果以1.1运行,它的某些功能可能会起作用-但它将无法在1.1 GAC中找到该2.0程序集.
Is the web-server (IIS or whatever) configured to run the folder as an application (i.e. shows as a cog), and is it using the correct version of ASP.NET? If it is running as 1.1, bits of it might work - but it would fail to find that 2.0 assembly in the 1.1 GAC.
这篇关于System.DirectoryServices在名称空间"System"中无法识别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!