error... :(

Oct 10, 2012 at 10:28 PM


I try 2 copy/paste your code in my app, because is very useful, but...

I use SharpDevelop 4.2.2 (latest) on Win 7 Home Premium x64.

My Project is targeted on .NET Framework 2.0 and the error is like this:

[Title] Unhanled exception

[Main Message] An exception of type System.NullReferenceException was thrown:

[Details] System.NullReferenceException: Object reference not set to an instance of an object.

        at PCInfo.MainForm.WindowsProductKey() in d:\Projects\PCInfo\PCInfo\MainForm.cs:line 118

        at PCInfo.MainForm.Button1Click(Object sender, EventArgs e) in d:\Projects\PCInfo\PCInfo\MainForm.cs:line 73

        ... etc etc etc

I made a function (WindowsProductKey()) and line 118 is line 63 in your source code:



Line 73 is Click event code handler for a button in MainForm.

Have any sugestion how can handle with this error ?

Thanks alot !

Oct 11, 2012 at 4:17 PM

Hmm from what I've been able to research, it has to do with the 32/64 bit thing when trying read stuff from the Registry.

You can fix it by going into the Project->Project options->Compiling-> and then change the Target CPU to "Any Processor"

Although SharpDevelop will then complain that it can't debug 64bit application so... not a great fix :S