ASP.NET "Object reference not set..." error
        Posted  
        
            by Roman
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Roman
        
        
        
        Published on 2010-04-16T15:06:25Z
        Indexed on 
            2010/05/25
            13:11 UTC
        
        
        Read the original article
        Hit count: 372
        
Hi,
I have a website written using ASP.NET. We have a development machine and a deployment server.
The site works great on the development machine, but when is transfered (using simple FTP Upload) generates strange behavior. It starts working just fine, but after a while stops working and throws an exception "Exception: Object reference not set to an instance of an object.".
The deal is that the absolute path of the website on the development machine is different than on the deployment server (and why should they be similar?) and the exact error is:  
Exception: Object reference not set to an instance of an object. at SOMEPROJECT_Objects.Player..ctor(Int32 PlayerID) in C:\inetpub\wwwroot\SOMEPROJECTSolution\ALLPROJECT\SOMEPROJECT_Objects\Player.cs:line 123 at SOMEPROJECT_GameLayer.M_Game.PlayerActiveGame(Int32 PlayerID) in C:\inetpub\wwwroot\SOMEPROJECTSolution\ALLPROJECT\SOMEPROJECT_GameLayer\M_Game.cs:line 85 at Web.getsms.Page_Load(Object sender, EventArgs e) in C:\inetpub\wwwroot\SOMEPROJECTSolution\ALLPROJECT\SOMEPROJECT-sms\Web\getsms.aspx.cs:line 59
The address that it is looking for is the address on the DEVELOPMENT machine, where as the site now resides on the deployment server.
Any ideas why this happens would be appreciated.
Thanks, Roman
© Stack Overflow or respective owner