CS0234:从直接服务类型或命名空间名称“的DirectoryServices”不存在命名空间中的“系统” (?是否缺少程序集引用)命名空间中不存在类型或名称空间名称“DirectoryServices”?
这页的做工精细,显示记录没有错误。但现在它给出了上述错误。
<asp:GridView ID="gvUsers" runat="server" AutoGenerateColumns="false" DataSourceID="odsUsers"
AllowPaging="true" AllowSorting="true" Width="100%">
<Columns>
<asp:TemplateField HeaderText="User Name">
<ItemTemplate>
<%#((System.DirectoryServices.DirectoryEntry)Container.DataItem).Properties["userPrincipalName"].Value%>
</ItemTemplate>
</asp:TemplateField>
/Columns>
</asp:GridView>
项目成功生成,但是当我打开网页,然后提示错误
当你打开网页,这是你正在构建的项目在同一台机器上? – mservidio
您是否已经添加了对您的项目的'System.DirectoryServices'程序集的引用? –
@marc_s:是System.DirectoryServices程序集已经添加。我也删除这个并再次添加,但同样的error.and另外一个这个错误还有其他机器(不是在谈论开发服务器)。这个网页工作很好,从最近几天。我在解决方案中添加了一些库项目,其中一个是窗口服务 – Ali