I am writing a feature, on activation it must create an entry in a list for every entry in a document library. I am using a webservice to get to the list which is on another sharepoint site. I am using the configurationmanager to get my credentials for the service. What goes wrong is, when I debug I get an object reference not set error. When I comment out my
subscriberListService.Credentials = new NetworkCredential(ConfigurationManager.AppSettings["Username"].ToString(), ConfigurationManager.AppSettings["Password"].ToString(), ConfigurationManager.AppSettings["Domain"].ToString());
line and activate, it works fine. If I put a breakpoint in my code just before the commented out line listed above and use the immediate window to execute the above line of code, it works fine, it finds the entries in the appsettings section in the config file and correctly applies them to the subscriberListService credentials.
Why is it having configuration manager issues on feature activation?