Last post Nov 28, 2008 02:09 AM by kanedogg
Nov 21, 2008 01:52 PM|Loisb|LINK
We installed AJAX on VS 2005 (framework 2.0) and started a new Ajax Control Toolkit Web site. We immediately noticed we now only have an sln (no vbproj). I assume this is ok. Then form by form we copied our existing forms and reports into the new project.
We had to recreate the datasets which we now put in an app_code directory. The F5 or build works great. However, periodically when we "Rebuild" we get "object reference not set to an instance of an object". However, we can build again and it works.
So we removed all our forms and started over, after we add the 5th rdlc, we get this error message. Then we delete the rdlc and still get the message. Sometimes we don't get the message. Please note, the error message is during the rebuild and does NOT
reference a file or line.
I read somewhere to set MSBuild project build output verbosity to Diagnostic, but I can't find where a file is created.
There is lots of stuff on the web out this mysterious message, but I can't seem to find out how to debug this message.
Any help as to how to research this error or fix it would be greatly appreciated.
Nov 21, 2008 02:33 PM|ewitkows|LINK
A few things to try...
Remove and Re-Add all project references
Clear Temp files (Start - Run - %temp%)
Clear .NET temp files (C:\Windows\Microsoft.NET\Framework\<framework ver>\Temporary ASP.NET)
Hope this helps
Nov 21, 2008 04:20 PM|Loisb|LINK
Thank you for your prompt reply, But unfotunately this did not work. I deleted everything, removed all project references and imported the references again. Any other idea?
Nov 27, 2008 05:38 AM|dclieu|LINK
Here is a good guide: http://codebetter.com/blogs/raymond.lewallen/archive/2005/06/23/65033.aspx
Quote from website:
"You are trying to use a reference variable who's value is Nothing/null. When the value is Nothing/null for the reference variable, that means it is not actually holding a reference to an instance of any object that exists on the heap. "
Simply put, you are trying to use a variable which has no value. It's empty, null, there is nothing in it. The above guide will answer everything. Try something like this:
VB (sorry no c#)
If variable is nothing
then response.write("there is nothing in it")
I am a newbie. Hopefully my post helped you
Nov 28, 2008 02:09 AM|kanedogg|LINK
Hi i'm a developer for a number of years now as many others here ! [|-)]
In explination to your error message there is generally 2 main causes to an error like the one you are currently getting just in case you aren't aware.
They are caused when a function or call cannot find a variable or item your trying to reference in your code. A usual fix is to set your objects to NEW if you haven't already
Or also set values of items to null.
allow me to give an example - asp.net/vb:
dim b as string
b = textbox1.text
msgbox("hi test", b.tostring())
dim b as new string
b = page.findcontrol('textbox1')
msgbox("hi test", b.text)
' would produce the exact same error your getting
dim gv as gridview = me.page.findcontrol('gridview1')
'a less likely way prevent that error
dim gv as NEW webcontrols.gridview
gv = me.gridview1
Hope this helps explain a little ??? The error in "laymens terms" saying to you hey hang on one second your asking me to goto "textbox1" and it doesnt exist, Or You want me to add value A which is 10 to Value B which i cannot find?
Hahaha hope this doesn't confuse [:P]