简体   繁体   English

C#:找不到类型或名称空间名称“?Attribute”(是否缺少using指令或程序集引用?

[英]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.

相关问题 找不到类型或名称空间名称“ MySql”(您是否缺少using指令或程序集引用?)c#VS 2013 - The type or namespace name 'MySql' could not be found (are you missing a using directive or an assembly reference?) c# VS 2013 c#错误1找不到类型或名称空间名称”(是否缺少using指令或程序集引用?) - c# Error 1 The type or namespace name '' could not be found (are you missing a using directive or an assembly reference?) 找不到类型或命名空间名称“ScriptName”(您是否缺少 using 指令或程序集引用?)修复 unity c# - The type or namespace name 'ScriptName' could not be found (are you missing a using directive or an assembly reference?) fix unity c# C#:找不到类型或名称空间名称“类”(是否缺少程序集引用的using指令?) - C#: The type or namespace name 'class' could not be found(are you missing a using directive for an assembly reference?) C# 错误 CS024 找不到类型或命名空间名称“Form1”(您是否缺少 using 指令或程序集引用?) - C# Error CS024 The type or namespace name 'Form1' could not be found (are you missing a using directive or an assembly reference?) C# 错误:错误 CS0246 找不到类型或命名空间名称“”(您是否缺少 using 指令或程序集引用?) - C# Error: Error CS0246 The type or namespace name '' could not be found (are you missing a using directive or an assembly reference?) CS0246 C#找不到类型或名称空间名称“ ForeignKeyAttribute”(是否缺少using指令或程序集引用?) - CS0246 C# The type or namespace name 'ForeignKeyAttribute' could not be found (are you missing a using directive or an assembly reference?) 如何解决C#错误“找不到类型或名称空间名称'[x]'(您是否缺少using指令或程序集引用?)” - How to fix C# error “The type or namespace name '[x]' could not be found (are you missing a using directive or an assembly reference?)” C# 错误 CS0246 找不到类型或命名空间名称“Socket”(您是否缺少 using 指令或程序集引用) - C# error CS0246 The type or namespace name 'Socket' could not be found (are you missing a using directive or an assembly reference) CS0246:找不到类型或名称空间名称“ T”。 您是否缺少using指令或程序集引用? 在C#中 - CS0246: The type or namespace name `T' could not be found. Are you missing a using directive or an assembly reference? in c#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM