Thanks for your suggestion however I need to get this working via code. My issue is that default site content created via a Starter Kit is not present until 'Republish entire site' via the content section is used. Ideally I need the package installer to rebuild the umbraco.config file. The code I have posted above isnt doing this when I think it should.
What exactly do you see when "it does not work"? Care to share your Umbraco log? Also, when/in what context exactly are you calling that code?
Note that contentService.RePublishAll() would rebuild the entire XML in cmsContentXml, which does not happen when you just delete the umbraco.config file. But if just deleting the file is OK for you then it means you probably did not want to rebuild the entire XML in cmsContentXml.
So yes, deleting the file does the same as umbraco.library.RefreshContent() ie it reloads the entire content cache from database cmsContentXml.
Rebuild umbraco.config
Does anyone know how to rebuild umbraco.config from code? Not sure if this is a bug with 7.2.7 however the following does not work:
Only 'Republish entire site' via content section of Umbraco CMS works.
Cheers,
Marc
Hi Marc,
You can remove physically umbraco.config file.
Thanks, Alex
Hi Alex,
Thanks for your suggestion however I need to get this working via code. My issue is that default site content created via a Starter Kit is not present until 'Republish entire site' via the content section is used. Ideally I need the package installer to rebuild the umbraco.config file. The code I have posted above isnt doing this when I think it should.
Cheers,
Marc
Marc, you can do like :
Hi Alex,
That worked a treat:
Cheers,
Marc
What exactly do you see when "it does not work"? Care to share your Umbraco log? Also, when/in what context exactly are you calling that code?
Note that contentService.RePublishAll() would rebuild the entire XML in cmsContentXml, which does not happen when you just delete the umbraco.config file. But if just deleting the file is OK for you then it means you probably did not want to rebuild the entire XML in cmsContentXml.
So yes, deleting the file does the same as umbraco.library.RefreshContent() ie it reloads the entire content cache from database cmsContentXml.
Wondering why the package content is not visible?
In addition: which starter kit is causing that issue? Just tried with the first one in the list and it worked.
is working on a reply...