开发者

Selenium RC compilation warning for C#

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?


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜