vb.net – 升级到.net 4时MembershipUser / System.Web.ApplicationServices的问题

我有一个大型的vb.net web项目,我试图升级到.net4 / VS2010.在编译期间,我收到以下错误:

‘System.Web.Security.MembershipUser’ in assembly ‘System.Web,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a’ has been forwarded to assembly ‘System.Web.ApplicationServices’. Either a reference to ‘System.Web.ApplicationServices’ is missing from your project or the type ‘System.Web.Security.MembershipUser’ is missing from assembly ‘System.Web.ApplicationServices’.

我研究了这个问题,错误是准确的.我添加了对System.Web.ApplicationServices的引用,但我仍然遇到问题.该项目似乎没有认识到已添加参考. Intellisense不会拿起它,我不能在Import语句中使用它等…

该程序集列在我的web.config的编译部分中:

<assemblies>
...
    <add assembly="System.Web.ApplicationServices,PublicKeyToken=31BF3856AD364E35"/>
</assemblies>

有任何想法吗?

我最近将项目从3.5升级到4.0并收到了您在上面定义的错误.我发现targetFramework属性未包含在web.config中的编译节点上.这解决了编译错误的问题.
compilation debug="false" strict="false" explicit="true" **targetFramework="4.0"**

相关文章

Format[$] ( expr [ , fmt ] ) format 返回变体型 format$ 强...
VB6或者ASP 格式化时间为 MM/dd/yyyy 格式,竟然没有好的办...
在项目中添加如下代码:新建窗口来显示异常信息。 Namespace...
转了这一篇文章,原来一直想用C#做k3的插件开发,vb没有C#用...
Sub 分列() ‘以空格为分隔符,连续空格只算1个。对所选...
  窗体代码 1 Private Sub Text1_OLEDragDrop(Data As Dat...