I have lot of custom entries to be made in a web config in SharePoint. Is there a way we can do it programatically. such as i have this to add under
<PageParserPath>
<PageParserPath VirtualPath="/*" CompilationMode="Always" AllowServerSideScript="true" IncludeSubFolders="true" />
also i have a complete new section to be added called
<connectionstring>
entries here
</connectionstring>
how can i do it programtically any ideas please
Use SPWebConfigModification:
http://spmatt.wordpress.com/2013/05/22/using-spwebconfigmodification-to-update-the-web-config-in-sharepoint-2013/
In your case you would have something along these lines:
You probably have to tweak the Xpath as I am not sure where this element lives in the web.config
You should use this in a feature receiver where you can get the reference to your webapplication and you should always remove them on feature deactivation