These forums are read-only and considered to be an archive. Please use the new Community for future interaction and posts.

Object reference not set to an instance of an obje

After a couple of hours of trying the sample code, the following error appeared out of nowhere.  Would appreciate any help as I simply cannot get the example page to load.

-----

Object reference not set to an instance of an object. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

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

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 


[NullReferenceException: Object reference not set to an instance of an object.]
   GleamTech.Web.Controls.FileVistaControl.Page_Load(Object sender, EventArgs e) +766
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +47
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Control.LoadRecursive() +131
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433 
M Woffenden 8/26/2008 2:00 PM
This is a very generic error. Did you add any custom code in Page_Load function? 
Cem Alacayir 9/1/2008 1:53 PM
I have the same problem...
Could someone help me?

Thank you
Stefano 10/1/2008 8:34 AM
I had the same problem when I deleted a file folder from the example2.  

I posted the error and have not got a response yet.  
W. David Taylor 10/9/2008 12:27 PM
I have the same problem... 
dpbarbella 10/11/2008 10:48 AM
I can re-create the problem.

FIRST:
- Clear the aspnet_wp in Task Manager
- Open you Examples project in VS
- Set Example2 (first) as start page
- Run Debug and I get the Object Reference error
- View in browser Example2 and same result

NEXT:
- Clear the 'aspnet_wp.exe. in Task Manager
- View in browser Example1 (it works)
- View in browser Example2 (it works)
- Debug Example2 (It works)

I don't know what that tells you other than it appears there is a consistent problem.

Please let us know. Thanks.

dpbarbella 10/11/2008 11:14 AM
I wonder if anyone is listening to this post.  

Hellooooooooooo

Anybody listening?
W. David Taylor 10/13/2008 11:39 AM
We have investigated the issue and found out the problem. The problem only occurs for trial versions. This will be fixed but to avoid the error, you need to set LicenseKey property to some arbitrary value. The problem does not occur in example1 because the property is set to some value in example.aspx (in markup code).

So in example2.cs, you need to set this property programmatically. For instance after the line

FileVistaControl fileVistaControl = (FileVistaControl)LoadControl("~/filevistacontrol/filevista.ascx");

Include the below line

fileVistaControl.LicenseKey = "temp";

It does not matter which value you set, you just need to set it so that the License object is initialized. Users which have already purchased a license code will not be effected by this problem as they already set this property to activate their control.
Cem Alacayir 10/14/2008 4:10 PM