1

Can anyone help me understand this error report:

Error: Object reference not set to an instance of an object.
at Project.Web.Config.Data.DataProvider.get_ConfigSettingsConnectionString() 
at Project.Web.Config.Data.DataProvider.GetConfigSettings() 
at Project.Web.Config.ConfigBase.GetConfigSettings() 
at Project.Web.Config.ConfigBase.GetConfigSettingValue(String configName) 
at Project.Web.Config.ConfigBase.StringConfigSetting(String configName, String defaultValue) 
at Project.Web.Config.Brands.get_BrandsConnectionString() 
at Project.Web.Engine.Brands.Data.BrandsDataProvider.GetBrandByHostname(String hostname) 
at Project.Web.Engine.Brands.Brands.CurrentBrand() 
at Project.Web.Engine.Placeholders.BrandedResource.GetHtmlContent(String resourcePostingName, String resourceName, String cultureCode) 
at Project.BWMembership.TranslationHelper.GetTranslation(String sResourcePostingName, String sResourceName, String sCultureCode) 
at Project.BWMembership.TranslationHelper.TranslateCountries(ListResponse[] arrCountries, String sCultureCodes) 
at ASP.update_aspx.Bind(Member oMembership, Order oOrder) in c:\Projects\Project\zsys_admin\update.aspx:line 82 
at ASP.update_aspx.Page_Load(Object sender, EventArgs e) in c:\Projects\Project\zsys_admin\update.aspx:line 58

I know it is telling me there is a null object, and it is coming from:

at Project.Web.Config.Data.DataProvider.get_ConfigSettingsConnectionString()

And I know the rest of the data is a list of methods leading to the error

I am trying to identify what the null object is and how to resolve it.

I know each line corresponds to calling a method, for example, I can call the method:

Project.BWMembership.TranslationHelper.TranslateCountries(ListResponse[] arrCountries, String sCultureCodes)

By typing that in my code. I know this method is in the DLL:

Project.BWMembership

and in the class:

TranslationHelper

and the method is called:

TranslateCountries(ListResponse[] arrCountries, String sCultureCodes)

But when I type:

Project.Web.Config.Data.DataProvider.get_ConfigSettingsConnectionString()

It does not recognize this.

Visual studio will offer me the code up to:

Project.Web.Config

But from there will stop.

Is it the case that Config is a class name, and Data is an instance of a different DLL included in Project.Web and being instantiated in this method?

If so, can I assume there is a class called DataProvider in this DLL that has a method called Get_ConfigSettingsConnectionString() ?

and if this is the case, does this mean essentially this is trying to find some data that does not exist? For example it is looking for a connection string that either does not exist in the existing web config, or is looking for a web config that does not exist?

Or is it that Project.Web.Config refers to the config file of the DLL?

Which opens up a whole new set of questions!

Alex
  • 3,730
  • 9
  • 43
  • 94

1 Answers1

0

There's no method named get_ConfigSettingsConnectionString(), but there's a propery named ConfigSettingsConnectionString (see this SO answer) in class DataProvider.

Generally speaking, you cannot infer the exact name of the DLL from full type name: for example, System.Int32 comes from mscorlib.dll.

Now, what the error you are having is telling you is that there's something inside get part of said property that is accessing a null object reference.

Community
  • 1
  • 1
Anton Gogolev
  • 113,561
  • 39
  • 200
  • 288