0

I made an updater program but when I run it on a pc that isn't a development pc it just crashes and I get a nullReferenceExeption.

System.NullReferenceException: De objectverwijzing is niet op een exemplaar van een object ingesteld. bij AutoUpdaterV1.Form_Main.StartUpdate() bij AutoUpdaterV1.Form_Main.Form_Main_Shown(Object eventSender, EventArgs eventArgs) bij System.Windows.Forms.Form.OnShown(EventArgs e) bij System.Windows.Forms.Form.CallShownEvent() bij System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme) bij System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj) bij System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) bij System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) bij System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) bij System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme) bij System.Windows.Forms.Control.InvokeMarshaledCallbacks()

Anyone who can help me?

Pikoh
  • 7,582
  • 28
  • 53
  • Hi there, can you please clarify what is different about the development pcs and the other computers the crash happens? Different OS? What are you trying to do in the Shown method that may potentially fail from machine to machine? – Clint Nov 29 '16 at 11:03
  • What are you updating? How are you updating? What about providing the source of your `StartUpdate()`? No crystal ball here. – C4d Nov 29 '16 at 11:03
  • Here's a link to the form class where the StartUpdate() method is. https://www.dropbox.com/s/ch0292v3bqbpakv/Form_Main.cs?dl=0 – JulesMarcus Nov 29 '16 at 11:06
  • Dropbox lol. Check http://stackoverflow.com/help/mcve – C4d Nov 29 '16 at 11:08
  • When I run it on windows 10 with visual studio etc installed it runs fine, but on clean windows 10 it doesn't. At the moment I'm running a virtual machine windows 7 but it still gives me this error. It also gives me a strange 'The Device is not ready' error at the beginning and I just can't seem to find any place where that could come from. – JulesMarcus Nov 29 '16 at 11:09
  • No one will take the time to download stuff anywhere. Still: http://stackoverflow.com/help/mcve – C4d Nov 29 '16 at 11:11
  • Sorry I'm new here...Just into my second year of programming and never posted on stackoverflow before. My bad. – JulesMarcus Nov 29 '16 at 11:12
  • Make sure that the machine that you are testing your software on has the correct version of the .net framework installed.(check target framework in your project settings and ensure that the same is installed on the other computer) – J. Tuc Nov 29 '16 at 11:52
  • I installed .net 4.5. It would start if it wasn't installed so that can't be the problem. – JulesMarcus Nov 29 '16 at 12:07
  • You can add `pdb` files to get line number information in the exception on problematic pc. The problem is in `AutoUpdaterV1.Form_Main.StartUpdate()` method, but knowing line may help a lot. – Sinatr Nov 29 '16 at 12:15

0 Answers0