VB3NET2003中的空引用错误 [英] Null Reference error in VB3NET2003

查看:59
本文介绍了VB3NET2003中的空引用错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是空引用错误以及如何解决?


我新安装的VB.Net2003给了我一个Microsoft

开发环境 ;错误消息框每次我都会尝试运行/启动任何项目 - 甚至是非常简单的项目。


错误说:

"

system.windows.forms.dll中发生未处理的

类型''System.NullReferenceException''异常。附加信息:对象

引用未设置为对象的实例。


我可以从调试器和帮助

屏幕,错误与取消引用

表格有关。但我甚至都不知道这意味着什么。


即使我打开一个包含

的项目,也只是一个空表格。并重新安装

VB.NET2003Standard没有解决问题。


这个错误是什么意思?可能是什么造成的?并且

如何修复它?


因为我怀疑我将能够找到这个

公告板/新闻组再次,我会是最好的

感激如果,在这里发布你的回复后,你也会

请通过电子邮件发送给我。我的电子邮件地址是
pa********@concentricxxx.netx xx xxx'已被删除。


谢谢,Paul S. Natanson(电话1-908-630-0406上午9点 - 9

PM美国东部时间) pa********@concentricxxx.netx xx

(删除xxxx来自电子邮件地址)。 2003年12月22日

What is a Null Reference error and how do I fix it?

My newly installed VB.Net2003 gives me a "Microsoft
Development Environment" error message box EVERY time I
try to run/start ANY project - even very simple ones.

The error says:

"An unhandled exception of
type ''System.NullReferenceException'' occurred in
system.windows.forms.dll. Additional information: Object
reference not set to an instance of an object."

As best I can determine from the debugger and the help
screens, the error has something to do with de-referencing
the form. But I don''t even know what that means.

This happens even when I open a project that contains
nothing more than an empty form. And reinstalling
VB.NET2003Standard did not solve the problem.

What does this error mean? What might be causing it? And
how do I fix it?

Because I doubt that I will ever be able to find this
bulletin board / news group again, I would be most
grateful if, after posting your reply here, you would also
please send it to me in an email. My email address is
pa********@concentricxxx.netxxx with the xxx''s removed.

Thanks, Paul S. Natanson (Phone 1-908-630-0406 9 AM - 9
PM eastern USA time) pa********@concentricxxx.netxxx
(remove xxxx''s from email address). December 22, 2003

推荐答案

嗨Paul,
Hi Paul,
什么是Null参考错误,我该如何修复它?
What is a Null Reference error and how do I fix it?




我试着用一个简单的方法告诉它。


当你宣布一个简单的全局类你做的程序

私人myClassInProgram作为myclass

然后对象(引用)不存在。


然后你可以创建它到处都是

myClassInProgram = new myclass

对象和引用存在于你的完整程序中


你也可以做在Sub或函数中
将myClassInProgram调暗为新的myclass

然后它只存在于声明和创建它的子或函数中。

我保留这个,其他我认为我只会混淆你,这是基本的。


我希望这有帮助吗?


Cor




I try to tell it on a simple way.

When you declare a simple class global in your program you do
Private myClassInProgram as myclass
But then the object (reference) does not exist.

Then you can create it everywhere with
myClassInProgram = new myclass
And the object and the reference exist in your complete program

You can also do in a Sub or a Function
dim myClassInProgram as new myclass
Then it only exist in the sub or function where it is declared and created.

I keep it with this, others I think I only confuse you, this is the basic.

I hope this helps?

Cor



*" Paul S. Natanson <一个******* @ discussions.microsoft.com> scripsit:
* "Paul S. Natanson" <an*******@discussions.microsoft.com> scripsit:
我新安装的VB.Net2003给了我一个Microsoft
开发环境。错误消息框我每次尝试运行/启动任何项目 - 甚至是非常简单的项目。

错误说:

未处理的例外
类型''System.NullReferenceException''发生在
system.windows.forms.dll中。附加信息:对象
引用未设置为对象的实例。

我最好能从调试器和帮助屏幕中确定,错误有所帮助使用取消引用表单。但我甚至都不知道这意味着什么。

即使我打开的项目只包含一个空表格,也会发生这种情况。并重新安装
VB.NET2003Standard没有解决问题。
My newly installed VB.Net2003 gives me a "Microsoft
Development Environment" error message box EVERY time I
try to run/start ANY project - even very simple ones.

The error says:

"An unhandled exception of
type ''System.NullReferenceException'' occurred in
system.windows.forms.dll. Additional information: Object
reference not set to an instance of an object."

As best I can determine from the debugger and the help
screens, the error has something to do with de-referencing
the form. But I don''t even know what that means.

This happens even when I open a project that contains
nothing more than an empty form. And reinstalling
VB.NET2003Standard did not solve the problem.




似乎是项目中的错误,而不是在IDE中。当您使用单个表单创建一个全新的项目时,这是否会发生这种情况(不是
打开现有项目)?进入bin您的

应用程序的文件夹并启动可执行文件:这是否也会抛出

异常?你在机器上安装了VS.NET

的测试版或试用版吗?


-

Herfried K. Wagner [MVP]

< http://www.mvps.org/dotnet>



Seems to be an error in the project, not in the IDE. Does this even
occur when you create a completely new project with a single form (not
opening an existing project)? Go into the "bin" folder of your
application and start the executable file: Does this throw the
exception too? Did you have any beta or trial versions of VS.NET
installed on the machine?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>


- ----原帖-----
*Paul S. Natanson
< an ******* @ discussion.microsoft.com> scripsit:
-----Original Message-----
* "Paul S. Natanson" <an*******@discussions.microsoft.com> scripsit:
我新安装的VB.Net2003给了我一个Microsoft
开发环境。错误消息框每次都是
我尝试运行/启动任何项目 - 甚至是非常简单的项目。

错误说:

未处理的例外
类型''System.NullReferenceException''发生在
system.windows.forms.dll中。附加信息:
对象引用未设置为对象的实例。

我最好能从调试器和帮助屏幕确定,错误有所帮助de-
参考表格。但我甚至都不知道这意味着什么。

即使我打开的项目只包含一个空表格,也会发生这种情况。并重新安装
VB.NET2003Standard没有解决问题。
My newly installed VB.Net2003 gives me a "Microsoft
Development Environment" error message box EVERY time I try to run/start ANY project - even very simple ones.

The error says:

"An unhandled exception of
type ''System.NullReferenceException'' occurred in
system.windows.forms.dll. Additional information: Object reference not set to an instance of an object."

As best I can determine from the debugger and the help
screens, the error has something to do with de- referencing the form. But I don''t even know what that means.

This happens even when I open a project that contains
nothing more than an empty form. And reinstalling
VB.NET2003Standard did not solve the problem.



似乎是项目中的错误,而不是在IDE中。



Seems to be an error in the project, not in the IDE.



当您使用
单一表单(未打开现有项目)创建一个全新项目时,是否会出现这种情况?进入bin文件夹
你的应用程序并启动可执行文件:这个
也抛出了这个例外吗?你有没有在机器上安装VS.NET版的测试版或试用版?

-
Herfried K. Wagner [MVP]
< http:/ /www.mvps.org/dotnet>


Does this evenoccur when you create a completely new project with a single form (notopening an existing project)? Go into the "bin" folder of yourapplication and start the executable file: Does this throw theexception too? Did you have any beta or trial versions of VS.NETinstalled on the machine?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
.



xxxxxxxxxxxxxxxxxxxxxx

Herfried:问题(空参考和错误)发生

即使我创建一个包含

只是一个表单的全新项目 - 即使表单完全空白且

为空。即使我进入

my" bin"文件夹并运行.exe文件。我从来没有任何

测试版或VB.NET的试用版。但我仍然在同一台PC上安装了Visual

Studio 6。你有什么想法

可能出错吗? Paul S. Natanson(电话1-908-630-

0406 9 AM - 美国东部时间晚上9点)
pa ******** @ concentricxxx.netx xx(从电子邮件中删除xxxx'

地址)。 2003年12月23日


xxxxxxxxxxxxxxxxxxxxxx

Herfried: The problem (a "Null Reference" error) occurs
even when I create a completely new project containing
just one form - even if the form is completely blank and
empty. I get the same error msg even when I go into
my "bin" folder and run the ".exe" file. I never had any
beta or trial versions of VB.NET. But I still have Visual
Studio 6 installed on the same PC. Do you have any ideas
on what might be wrong? Paul S. Natanson (Phone 1-908-630-
0406 9 AM - 9 PM eastern USA time)
pa********@concentricxxx.netxxx (remove xxxx''s from email
address). December 23, 2003


这篇关于VB3NET2003中的空引用错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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