无法添加对我的项目的引用-它根本无法检测到它 [英] Can't add a reference to my project - it simply doesn't detect it
问题描述
因此,我找到了一个名为 WatiN 的精彩库-我已经下载了最新版本-v2.1. 我打开了一个控制台应用程序(显然是C#),并编写了最简单的程序:
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();
没什么.
显然我是通过右键单击项目>添加引用>浏览到C:\...\WatiN\bin\net40
,选择WatiN.Core.dll
来添加对项目的引用(如自述文件所述)
VS会自动完成我的键入-他为我提供了其他选择(您知道-当您键入con时,他会显示lil'窗口并向您显示Console
等)-就像他应该的那样,因为我已经添加了参考文献.
然后我进行了编译-突然-VS变得盲目,他无法检测到我引用的DLL.
该DLL仍显示在我项目的References
文件夹中-但VS抱怨没有.
他说:The type or namespace name 'WatiN' does not exist in the namespace 'WatiN' (are you missing an assembly reference?)
尽管他在编译之前没有显示这些错误-并用绿色标记了Firefox
(因为它是类).
谁能帮我这个?也许我很好,怎么了?
另一件事-双击引用(即对象浏览器)中的DLL时,它会向我显示,并且一切正常-但在尝试编译后,它会神奇地消失.
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.
推荐答案
在项目设置中,将目标框架从".NET Framework 4客户端配置文件"更改为".NET Framework 4".那对我有用.
In your project settings, change your Target Framework from ".NET Framework 4 Client Profile" to ".NET Framework 4". That did the trick for me.
这篇关于无法添加对我的项目的引用-它根本无法检测到它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!