Problems with MembershipUser / System.Web.ApplicationServices when upgrading to .net 4

独自空忆成欢 提交于 2019-12-08 21:47:56

问题


I have a large vb.net web project that I am trying to updgrade to .net4/VS2010. During compile I get the following error:

'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'.

I researched the issue and the error is accurate. I added a reference to System.Web.ApplicationServices but I am still having problems. The project does not seem to recognize that the reference has been added. Intellisense will not pick it up, I can not use it in an Import statement, etc ...

The assembly is listed in the compile section of my web.config:

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

Any ideas?


回答1:


I recently upgraded a project from 3.5 to 4.0 and received the errors as you defined above. I found that the targetFramework attribute was not included on compilation node in the web.config. This solved my problems with the compilation errors.

compilation debug="false" strict="false" explicit="true" **targetFramework="4.0"**   



回答2:


Check that the projects on which that one depends also reference System.Web.ApplicationServices.




回答3:


Add a reference to the System.Web.Extensions.dll and then try.




回答4:


PublicKeyToken=31BF3856AD364E35 specified in your compile section of Web.config is different than the requested one (PublicKeyToken=b03f5f7f11d50a3a). Check this out.



来源:https://stackoverflow.com/questions/2980964/problems-with-membershipuser-system-web-applicationservices-when-upgrading-to

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!