Object reference not set to an instance of an object.

mercoledì 10 ottobre 2007 - 10.17

Gemini Profilo | Expert

Ciao a tutti,
ho caricato su un server con windows server 2003 una piccola applicazione.
Quando apro una pagina mi da questo errore:
Object reference not set to an instance of an object.

Il problema è che non so come risolverlo perchè in locale funziona perfettamente.
Ho assegnato tutti gli oggetti che avevo impostato a null, ma continua a non funzionare.
Grazie mille

bluland Profilo | Guru

Ciao,

ti dovrebbe dare anche la riga di codice che fa scaturire l'errore
verifica!


--------------------
Vincenzo PESANTE
System Engineer

Anonimo Profilo | Senior Member

è molto probabile che se usi dei web services non trova i riferimenti, oppure involontariamente hai schiantato nel codice qualche riferimento o path che sulla macchian con win 2003 server non corrisponde.

Gemini Profilo | Expert

Ciao,
questo è l'errore che ricevo:

Server Error in '/' Application.
--------------------------------------------------------------------------------

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.]
SystemLibrary.ConstSystem..ctor()
Classi.clsMeteo..ctor()
MioSito.Home.Meteo.Page_Load(Object sender, EventArgs e)
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750

Ho lasciato solo questa riga di codice. La classe clsMeteo non ha nulla.

private void Page_Load(object sender, System.EventArgs e)
{
clsMeteo Meteo = new clsMeteo();
}

Perchè mi da errore quando crea la classe?
Grazie mille

Anonimo Profilo | Senior Member

Non trova il namespace dove è contenuta la classe, verifica la dll generata e prova a riportare di nuovo tutto sul nuovo server e ricompilare.


Gemini Profilo | Expert

Ciao,
ho risolto il problema. In una classe c'era degli attributi dichiarati male.

Però ora ricevo questo errore:

Server Error in '/' Application.
--------------------------------------------------------------------------------

The remote server returned an error: (404) Not Found.
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.Net.WebException: The remote server returned an error: (404) Not Found.

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:


[WebException: The remote server returned an error: (404) Not Found.]
System.Net.HttpWebRequest.CheckFinalStatus() +680
System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) +139
System.Net.HttpWebRequest.GetResponse() +249
Classi.clsMeteo..ctor()
Miosito.Home.Meteo.Page_Load(Object sender, EventArgs e)
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750


Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5