2
votes

I add selenium reference to the project and work ok but when i click rebuild project i get this error:

Error 3   The type or namespace name 'Selenium' could not be found (are you

missing a using directive or an assembly reference?) D:\PROJEKTI\crawler\WebCrawlerSuite\NCrawler\Net 4.0\NCrawler.WinDemo\SeleniumHtmlDocumentProcessor.cs 6 7 NCrawler.WinDemo

and this warning:

Warning   2   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. NCrawler.WinDemo

what can be wrong?

1

1 Answers

8
votes

I'm guessing this is because your project is using the Client Profile ("Profile=Client" in the framework version). Try setting the target framework to plain old ".NET Framework 4" in your project properties and see if that does the trick.

In this case, the Selenium assembly is referencing System.Web, which is not allowed for the Client profile framework. See http://msdn.microsoft.com/en-us/library/cc656912.aspx for details.