I have no real clue as to why and where this error occurs but I have a feeling it is to do with the multiple namespaces/tiers in the code.
My project is a replica of ThePhile but I have changed the root namespace to LA (from Wrox).
The business tier (Accounts.Business) does not want to read the connection string from the data tier (Accounts.Data) but I have no idea why.
Using the connection string directly in the AccountsTool class of Accounts.Business gets the "States" list on the new account page to databind but soon enough I run into trouble:
http://localhost/LAvb/WebModules/Accounts/new.aspx
Error Message:
Value cannot be null.
Parameter name: value
Error Stack:
System.ArgumentNullException: Value cannot be null.
Parameter name: value
at System.Web.Caching.CacheEntry..ctor(String key, Object value, CacheDependency dependency, CacheItemRemovedCallback onRemovedHandler, DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, Boolean isPublic)
at System.Web.Caching.CacheInternal.DoInsert(Boolean isPublic, String key, Object value, CacheDependency dependencies, DateTime utcAbsoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority, CacheItemRemovedCallback onRemoveCallback, Boolean replace)
at System.Web.Caching.Cache.Insert(String key, Object value)
at System.Web.Caching.Cache.set_Item(String key, Object value)
at LA.WebModules.Accounts.Configuration.ModuleConfig. GetSettingsFile() in C:\VBprojects\Accounts.Configuration\ModuleConfig.
vb:line 95
at LA.WebModules.Accounts.Configuration.ModuleConfig. GetSettings() in C:\VBprojects\Accounts.Configuration\ModuleConfig.
vb:line 34
at LA.WebModules.Accounts.Business.User..ctor() in C:\VBprojects\Accounts.Business\User.
vb:line 33
at LA.WebModules.Accounts.Web.NewUser.Register_Click( Object sender, EventArgs e) in C:\VBprojects\VSWebCache\ASSETID-01464\LAvb\WebModules\Accounts\New.aspx.
vb:line 81
at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
at System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
at System.Web.UI.Page.ProcessRequestMain()