简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM