-3

I have a web application that is working great while running form VS, but once it's published trying to navigate to the site throws a NullRefernceException. Here is the stack trace:

[NullReferenceException: Object reference not set to an instance of an object.]
DAL.VendorRepDAL.GetRepsInfo(List`1 fields) in C:\Users\mfoster\Desktop\EventPlanner\DAL\DAL.vb:649
EventPlanner.DealEntry.LoadData() in C:\Users\mfoster\Desktop\EventPlanner\EventPlanner\deals.aspx.vb:31
System.Web.UI.Control.LoadRecursive() +70
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3063

I think the problem may have something to do with the fact that file paths in the stack trace are referencing my hard drive for some reason. If that's the case I'm not how to fix it.

Thanks For any help.

mf0st3r
  • 3
  • 1
  • Please add more detail such as the portion of the source code that is throwing the error. – lucuma May 17 '12 at 22:12
  • There is no "portion of the source code that is throwing the error". As stated it is working fine in development and only throws the exception when published. Kind of hard to debug when it is only happening on the live site. – mf0st3r May 17 '12 at 22:16
  • I'd suggest you identify what part of your application is throwing the error and then post that CODE in your question along with .net version, iis version and app pool basic settings. The error above is an exception from your code. – lucuma May 17 '12 at 22:19
  • @mf0st3r, the message says the source of the error: `DAL.VendorRepDal.GetRepsInfo`. So start with posting that part of your code. – Brandon May 17 '12 at 22:26
  • 2
    "Kind of hard to debug when it is only happening on the live site." Not to be rude but it is kind of hard for US to debug what is only happening on YOUR live site too =) – nvuono May 17 '12 at 22:38
  • Also, the file path references are just from the .pdb file and nothing to worry about with relation to the actual file. It's just a way for you to backtrack and look at the specific line DAL.vb:649 – nvuono May 17 '12 at 22:39

1 Answers1

1

Sherlock Holmes might deduce that since this error comes from a class named DAL, either:

  • Your live application does not have a valid database connection string, or
  • The database your live application is connecting to does not have the tables and/or rows and/or data that it expects.

The rest of us, however, might need to see a bit more code, such as the GetRepsInfo method that seems to be throwing.

Common causes and fixes for NullReferenceException can be found here: What is a NullReferenceException, and how do I fix it?

Community
  • 1
  • 1
mafue
  • 1,858
  • 1
  • 21
  • 27
  • 1
    Thanks Sherlock. It was the connection string. It was using integrated security and failing for authentication on the DB. Just needed to create a user on the DB and change the connection string. – mf0st3r May 17 '12 at 23:13
  • Sherlock would have also deduced that the OP would probably benefit more from learning how to debug an application and to read server logs. Well played sir. – lucuma May 18 '12 at 01:13