Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't add a reference to my project - it simply doesn't detect it

So I found this wonderful library called WatiN - and I've downloaded the latest version - v2.1. I've opened a Console Applications (obviously C#) and wrote my most simplest program:

using WatiN.Core;
...
FireFox browser = new FireFox(@"..");
browser.Button("Send").Click();
browser.Dispose();

It's nothing much. I obviously added a reference to my project by right-clicking the project > Add Reference > browsed to C:\...\WatiN\bin\net40, chose WatiN.Core.dll (like the Readme said) The VS was auto completing my typing - and he offered me alternatives (you know - when you type con and he shows that lil' window and showing you Console etc) - like he should, because I've added the reference. Then I hit compile - and suddenly - VS turns blind and he can't detect the DLL I referenced. The DLL still shows up in the References folder in my project - but VS whines that it doesn't. He says: The type or namespace name 'WatiN' does not exist in the namespace 'WatiN' (are you missing an assembly reference?) Although he did not show those errors before compile - and marked Firefox in green (because its a class). Can anyone help me with this? Maybe well me whats wrong ? Another thing - when double clicking the DLL in the reference (aka Object Browser) it shows me it and everything's OK - but after I try to compile - it magically disappears.

like image 908
Mark Segal Avatar asked Jul 18 '11 23:07

Mark Segal


People also ask

How do I resolve a reference problem in Visual Studio?

To fix a broken project reference by correcting the reference path. In Solution Explorer, right-click your project node, and then select Properties. The Project Designer appears. If you're using Visual Basic, select the References page, and then click the Reference Paths button.

How do I enable references in Visual Studio?

Press Shift + F12 to find all references.

How do I add a reference to a shared project?

You add references to a shared project just as you would a normal project reference. In Visual Studio or Fire, you right-click the "References" node of the real project and choose "Add Reference", and then pick the shared project from the list.


1 Answers

In your project settings, change your Target Framework from ".NET Framework 4 Client Profile" to ".NET Framework 4". That did the trick for me.

like image 105
Christian Henning Avatar answered Oct 29 '22 09:10

Christian Henning