SharePoint 2010: Setting SafeControl "SafeAgainstScript" property on web part installation -


is there way set safeagainstscript property of safecontrol entry in web.config file true upon installation / upgrade of web part? (it defaults false)

the safecontrol entry should appear follows:

<safecontrol assembly="microsoft.sharepoint, ..." namespace="microsoft.sharepoint" typename="*" safe="true" safeagainstscript="true" /> 

i installing third party web part , not have go , edit config file each time web part re-installed or upgraded.

well guess theres no "easy" way it.

you can edit web.config using spwebconfigurationmodification class http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spwebconfigmodification.aspx

http://msdn.microsoft.com/en-us/library/bb861909.aspx

however, can tricky , not recommendeded - safecontrol entries meant put in manually or using .wsp's manifest.xml file

so open .wsp winrar or 7zip, extract manifest.xml, make change safecontrol entry , reassemble , deploy it.

if want automate process, can using http://msdn.microsoft.com/en-us/library/system.io.packaging i'm sure find code snippets aswell


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -