Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 408
DaveK Avatar asked Jun 05 '10 15:06

DaveK


3 Answers

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

like image 136
Cosmin Avatar answered Nov 15 '22 04:11

Cosmin


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"**   
like image 38
Scott Gerold Avatar answered Nov 15 '22 03:11

Scott Gerold


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

like image 31
NoAlias Avatar answered Nov 15 '22 03:11

NoAlias