Jump to content
Xtreme .Net Talk

'System.NullReferenceException' when starting ANY vb.net application


Recommended Posts

Posted (edited)

UPDATED - 'System.NullReferenceException' when starting ANY vb.net app (on paint)

 

Hello,

 

I have a problem every time I launch an app in vb.net. This happens if I run it from the debugger or if I make the project first and run the exe. I have removed and reinstalled both vs.net and .net framework and still have this issue.

 

Whenever I launch any application, no matter what method I use to open the main form and no matter what controls are on the form I get the same error within 30 seconds of the form opening.

 

I get:

 

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.

 

:with the error on the form declaration (ie. Public Class Form1).

 

Does anyone have any idea what this could be?

 

Thanks

Edited by gonorato
Posted

Update to problem

 

Hello,

 

After much testing I have gotten it down to the fact that it only happens when the forms paint.

 

I have not renamed the forms. I have tried using sub main to instantiate the form and I have tried just using the form as the start up object and either way it happens.

 

If I leave the form with focus nothing happens but as soon as it is forced to repaint.... boom on

 

> system.windows.forms.dll!System.Windows.Forms.Application::ComponentManagerSystem.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(__int32 dwComponentID = 1, __int32 reason = 4, __int32 pvLoopData = 0) + 0x19b bytes

 

Any ideas would be greatly appreciated as I can't do any work right now at all.

 

BTW... I am unfortunatly on Windows XP Home Edition right now... if that matters

Posted

More Info

 

Hopefully someone can help. I spent all day with this thing.

 

It seems to happen whenever the form gets focus after initially losing focus. If I put some msgbox or other function in the paint or activate routines the error occurs before the fire.

 

Any help.. anyone .. anyone.... ?

Thanks :)

Posted

i was under the impression that you must have XP Pro to run VS.NET... is this only certain editions... my copy won't install on home

you sad this happens for every applicatoin?

even if you start and new project and run it?

try just running an empty project.. and work your way up from there

send us some code too that would be nice

i'm not lazy i'm just resting before i get tired.
Posted

Hello,

 

It happens on any project with a form, even if I do nothing but add a blank form and run the project. As soon as the form loses focus and regains it it crashes.

Posted

has this always been the case or did it happen all of a sudden?

if it's always been the case my guess would be because you are using home edition, I'm fairly sure Home Edition doesn't run VS.NET. Although i'm suprised you got that far if that is the case, because my friend couldn't even load vs.net on his xp home edition.

my school actually provided us all with xp pro if needed just so we could load the software. Could just be the version we are given.

If that's not the case then... well that's super wierd, i'd start to hate computers about now if i were you lol.

i'm not lazy i'm just resting before i get tired.
  • *Gurus*
Posted

VS.NET should work on Home Edition just fine, except that as it doesn't have a webserver you won't be able to use any of the ASP.NET stuff. Perhaps the dialog explaining this during setup is misleading.

 

Having said that, I've never tried it :)

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Posted
Unfortunatly XP home came with this laptop but yes it did explain that you can not do asp.net work. For now I have 3 stand alone apps I have to get done. Then I will likely go and get the upgrade.
  • 1 year later...
Posted

Not a real solution

 

This was a while ago but I don't think I ever "solved" it. I ungraded that machine to XP Pro and it started working fine. Not much of a solution, I know.

 

I am having a similar problem' date=' have you found a solution yet?[/quote']

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...