今天项目中用到了ldap,结果给项目添加System.DirectoryServices reference以后,点击重新build website,还是报不到System.DirectoryServices程序集,郁闷,接着

我到web.config中查看,在system.web配置节下明明有添加进来程序集,代码截图如下:

1 <compilation debug="true">
2             <assemblies>
3                 <add assembly="System.DirectoryServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
4             </assemblies>
5         </compilation>

没办法,继续google搜索解决办法,半个小时过去了,没有答案,正在这时,我想起来以前一个项目中叶用到了ldap,我去看看那个项目中怎么添加的System.DirectoryServices程序集

打开原来的项目,问题终于知道了,原来得指定 targetFramework为4.0,因为我使用的是vs2010.Net framework4.0。正确配置如下:

 

1 <compilation debug="true" targetFramework="4.0">
2             <assemblies>
3                 <add assembly="System.DirectoryServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
4             </assemblies>
5         </compilation>

今天周五,明天可以不用上班了,解决了这个问题真是很爽,不过后面还有很多难题在等着我,active directory membership provider 和role Manager。继续加油

 

posted on 2010-11-05 14:27  cwe  阅读(357)  评论(0编辑  收藏  举报