简体   繁体   English

无法添加对我的项目的引用 - 它根本没有检测到它

[英]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.所以我找到了这个很棒的库,叫做WatiN - 我已经下载了最新版本 - v2.1。 I've opened a Console Applications (obviously C#) and wrote my most simplest program:我打开了一个控制台应用程序(显然是 C#)并编写了我最简单的程序:

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.我显然通过右键单击项目 > 添加参考 > 浏览到C:\...\WatiN\bin\net40添加了对我的项目的引用,选择了WatiN.Core.dll (如自述文件所述)VS自动完成我的打字 - 他给了我替代品(你知道 - 当你输入 con 并且他显示 lil' window 并向你展示Console等) - 就像他应该的那样,因为我已经添加了参考。 Then I hit compile - and suddenly - VS turns blind and he can't detect the DLL I referenced.然后我点击编译 - 突然 - VS 失明,他无法检测到我引用的 DLL。 The DLL still shows up in the References folder in my project - but VS whines that it doesn't. DLL 仍然出现在我项目的References文件夹中 - 但 VS 抱怨它没有。 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).他说: The type or namespace name 'WatiN' does not exist in the namespace 'WatiN' (are you missing an assembly reference?)尽管他在编译之前没有显示这些错误 - 并将Firefox标记为绿色(因为它是一个类) . 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.另一件事-当双击参考中的DLL(又名Object浏览器)时,它向我显示了它并且一切正常-但是在我尝试编译后-它神奇地消失了。

In your project settings, change your Target Framework from ".NET Framework 4 Client Profile" to ".NET Framework 4".在您的项目设置中,将目标框架从“.NET Framework 4 Client Profile”更改为“.NET Framework 4”。 That did the trick for me.这对我有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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