System.Object 未在 VB.Net 中定义 [英] System.Object not defined in VB.Net

查看:19
本文介绍了System.Object 未在 VB.Net 中定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出于某种原因,可能是由于无意中的更改,我在编译时遇到了许多错误:未定义类型 System.Object 和 System.EventArgs...请注意,对于某些传入参数,我不知道没有看到智能感知抱怨(即没有编译错误)--- 2 个屏幕截图显示同一页面的 2 个部分...

for some reason, maybe due to an inadvertent change I am getting a number of errors on compilation that say:: Type System.Object, and System.EventArgs are not defined...PLEASE NOTE that for some incoming parameters i don't see the intellisense complain (i.e. no compilation error) --- the 2 screenshots display 2 sections of the same page...

我在顶部有以下 Imports 指令,但显然没有帮助:

I have the following Imports directive at the top which does not apparently help:

Imports System.Object
Imports System.EventArgs

我在顶部有以下 Imports 指令,但显然没有帮助:

I have the following Imports directive at the top which does not apparently help:

Imports System.Object
Imports System.EventArgs

推荐答案

找到您在代码中声明的 System 类或模块.右键单击源代码中的系统"并选择转到定义"应该会带您到它.将其重命名为其他名称.

Find the System class or module that you declared in your code. Right-clicking "System" in your source code and picking "Go to Definition" ought to take you to it. Rename it to something else.

在 VB.NET 中要小心,它往往会向全局命名空间添加大量标识符.避免使用模块,而使用类.并且强烈支持使用 Namespace 关键字.

Be careful with this in VB.NET, it tends to add lots of identifiers to the global namespace. Avoid modules, use classes instead. And strongly favor using the Namespace keyword.

这篇关于System.Object 未在 VB.Net 中定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆