gonorato Posted March 25, 2003 Posted March 25, 2003 (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 March 25, 2003 by gonorato Quote
Cassio Posted March 25, 2003 Posted March 25, 2003 Are you instanciating your form? Quote Stream of Consciousness (My blog)
Moderators Robby Posted March 25, 2003 Moderators Posted March 25, 2003 Did you rename the form or class? Quote Visit...Bassic Software
gonorato Posted March 25, 2003 Author Posted March 25, 2003 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 Quote
gonorato Posted March 26, 2003 Author Posted March 26, 2003 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 :) Quote
Moderators Robby Posted March 26, 2003 Moderators Posted March 26, 2003 You put a msgbox in the Activate event? That would cause it to fire endlessly. Quote Visit...Bassic Software
gonorato Posted March 26, 2003 Author Posted March 26, 2003 Yes, I'm aware. I just wanted to see IF it would fire before the error. Which it does once. Quote
bpayne111 Posted March 26, 2003 Posted March 26, 2003 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 Quote i'm not lazy i'm just resting before i get tired.
gonorato Posted March 26, 2003 Author Posted March 26, 2003 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. Quote
bpayne111 Posted March 26, 2003 Posted March 26, 2003 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. Quote i'm not lazy i'm just resting before i get tired.
*Gurus* divil Posted March 26, 2003 *Gurus* Posted March 26, 2003 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 :) Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
gonorato Posted March 26, 2003 Author Posted March 26, 2003 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. Quote
rehand Posted June 14, 2004 Posted June 14, 2004 Solution Yet? I am having a similar problem, have you found a solution yet? Quote
gonorato Posted June 14, 2004 Author Posted June 14, 2004 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'] Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.