views:

36

answers:

2

When I compile my code in VS 2010 (.NET 4.0), I get the following warning:

"Warning 1: The referenced assembly "ThoughtWorks.Selenium.Core" could not be resolved because it has a dependency on "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project."

(It calls it a warning but it's really an error because the Selenium namespace can't be used because of this.) I tried adding/removing references to the System.Web namespace with no luck. Does anyone know how to fix this?

A: 

Your project may have been targeting lower version of .NET Fx (2.0 or 3.5) - this (multi-targeting) was possible with VS 2008 and made better with VS 2010. Check your project properties - application tab.

VinayC
+2  A: 

Try changing the Target Framework from ".Net Framework 4 Client Profile" to just ".Net Framework 4"

The client profile is a sort of "slimmed down" version of the .Net 4 framework.

corvuscorax
That did it. Thanks!
Nick