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

与世无争的帅哥 提交于 2020-01-14 07:32:29

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/6740744/cant-add-a-reference-to-my-project-it-simply-doesnt-detect-it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!