2013-10-18 41 views
0

我对.NET很新。我在4.0,Visual Studio 2010中使用C#开发了一个Web项目。我在我的项目中添加了一个参考System.DirectoryServices,然后在我的代码页中使用它。本地没有生成错误。我也有属性复制本地设置为“真正”(我这样做只是为了获得在当地认可的参考...也许这也是一个问题)。当我将我的项目部署到我的生产服务器时,找不到命名空间System.DirectoryServices

当我将项目部署到我的生产服务器时,找不到命名空间,尽管在暂存共享中我确实在bin文件夹中看到了DLL。我得到这个错误:

Compiler Error Message: CS0234: The type or namespace name 'DirectoryServices' does not exist in the namespace 'System' (are you missing an assembly reference?)

我不知道我错过了什么设置或配置来获得这种参考是我的生产服务器可见。让我知道是否需要更多信息。谢谢!

回答

0

我在我的web.config文件中添加了程序集,现在页面可以工作。

<compilation debug="true" targetFramework="4.0"> 
      <assemblies> 
       <add assembly="System.DirectoryServices, Version=4.0.0.0,Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> 
      </assemblies> 
</compilation> 
相关问题