[英]C#:The type or namespace name '?Attribute' could not be found (are you missing a using directive or an assembly reference?
I was coding my program and out of nowhere I get the following: 我正在编写程序,却无所适从:
The type or namespace name '?Attribute' could not be found (are you missing a using directive or an assembly reference? 找不到类型或名称空间名称“?Attribute”(是否缺少using指令或程序集引用?
I got it after trying to add the dll: mshtml 我尝试添加dll后得到它:mshtml
I removed it but the error doesnt go away. 我将其删除,但错误不会消失。
Another error I get is: 我得到的另一个错误是:
Invalid token '(' in class, struct, or interface member declaration 类,结构或接口成员声明中的令牌'(')无效
and... 和...
'System.Windows.Forms.MessageBox.Show(System.Windows.Forms.IWin32Window, string)' is a 'method' but is used like a 'type 'System.Windows.Forms.MessageBox.Show(System.Windows.Forms.IWin32Window,string)'是一种'方法',但其用法类似于'type
I tried closing out of the IDE and reopening it to see if the error went away but it didnt. 我尝试关闭IDE并重新打开它,以查看错误是否消失了,但事实并非如此。
Any help is appreciated, thanks :) 任何帮助表示赞赏,谢谢:)
EDIT: Here is a sample code where the error comes from. 编辑:这是错误来自哪里的示例代码。 Note several other items in my code have the same of similar errors: 请注意,我的代码中的其他几项具有相同的类似错误:
The error is in 错误在
if (webBrowser1 如果(webBrowser1
and 和
Show 节目
if (webBrowser1.DocumentText.Contains("Text here"))
{
MessageBox.Show("TText.......");
}
引用?Attribute
name表示您的属性声明格式不正确,很可能后面跟着非ASCII unicode字符-在任何其他错误之前,请检查代码文件中是否出现错误的“ [”(方括号)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.