I am trying to create new Sitecore item, using Visual Studio solution. But When I call master database I get the error Could Not read Sitecore Configuration. I know this question is already asked but the solution provided is not clear to me.
Can anyone please guide me to exactly which publishing values may get overridden by my web.config file so that I can correct it.
Another solution which is provided is to give edit/modify access for the IIS user on the website folder. It didn't worked for me.
public class MyItem
{
public void CreateItem()
{
using (new Sitecore.SecurityModel.SecurityDisabler())
{
Sitecore.Data.Database masterDB = Factory.GetDatabase("master");
Item parentItem = masterDB.GetItem(new ID("{140DC116-E743-4C02-9F08-CB73151A5163}"));
TemplateItem template = masterDB.GetTemplate(new ID("{C9B284A6-0427-4296-8217-E8A3F728D8F0}"));
parentItem.Add("RanjitAsset1", template);
}
}
}