Regarding your supplemental file not being applied to web. Config: From MSDN : "You can retroactively apply changes to the web. Config files of the server by running the copyappbincontent Stsadm command-line operation.
You must run the operation on each front-end web server in the deployment.
Regarding your supplemental file not being applied to web. Config: From MSDN: "You can retroactively apply changes to the web. Config files of the server by running the copyappbincontent Stsadm command-line operation.
You must run the operation on each front-end web server in the deployment.
1 Note that this operation will deploy config changes to all of the web applications on the machine. – Russell Jun 1 '11 at 6:40.
As Russ and breischl suggest, you can make use of the WebConfigModifications property of the SPWebApplication object. To deploy this together with your feature, put your code in a feature receiver. That way, you can make the web.
Config modifications automatically when the feature is installed. In your feature receiver, don't forget to call the ApplyWebConfigModifications() property on your SPWebApplication object. Example: weblogs.asp.net/wesleybakker/archive/200... You can package both your feature and your feature receiver assembly in a single wsp package.
Thanks for the link - I'm getting an error when attempting this approach. I've added a seperate SO question to track this error @ stackoverflow.com/questions/3478441/… – Wallace Breza Aug 13 '10 at 15:40 This approach seems to address all of the Wallace's concerns. This may not work if the order of entries under a node matters e.g. For HttpModule registration.
– Jason Weber Aug 13 '10 at 15:44.
When creating a supplemental config file, the web. Config modifications are NOT automatically merged until you make a call to stsadm -o copyappbincontent. You can also force this command to be run through a FeatureReceiver.
After exploring the stsadm tool in reflector I found that the copyappbincontent operation makes a call to SPWebApplication.WebService. ApplyApplicationContentToLocalServer()' public override void FeatureActivated(SPFeatureReceiverProperties properties) { var webApp = (SPWebApplication)properties.Feature. Parent; webApp.WebService.
ApplyApplicationContentToLocalServer(); } Props to @Jason Weber for figuring this out, but unfortunately he put his answer in a comment rather than a question.
Put this in a fole called AddWebConfigMods. Ps1 Param ($weburl, $WebConfigModifications ) $url = New-Object System. Uri($webUrl) System.Reflection.
Assembly::LoadWithPartialName("Microsoft. SharePoint") | Out-Null $webApp = Microsoft.SharePoint.Administration. SPWebApplication::Lookup($url) #delete mods by the owners being added $ownerstodelete = $WebConfigModifications | Group-Object owner | Select-Object Name foreach($owner in $ownerstodelete) { $modstodelete = @() foreach($mod in $webApp.
WebConfigModifications) { if($mod. Owner -eq $owner. Name) { $modstodelete += $mod } } Write-Host ("Deleting " + $modstodelete.
Count + " mods for owner: " + $owner) foreach($delmod in $modstodelete) { Write-Host (" + Deleting " + $delmod. Value) $webApp. WebConfigModifications.
Remove($delmod) | Out-Null } } #this is where we start to add mods $i = 0; Write-Host ("Adding " + $WebConfigModifications. Count + " webconfig modifications to " + $weburl) foreach($modEntry in $WebConfigModifications) { Write-Host (" + Adding " + $modEntry. Value) $mod = New-Object Microsoft.SharePoint.Administration.
SPWebConfigModification $mod. Path = $modEntry. Path $mod.Name = $modEntry.
Name $mod. Sequence = $i++ $mod. Owner = $modEntry.
Owner $mod. Type = $modEntry. Type $mod.
Value = $modEntry. Value $webApp. WebConfigModifications.
Add($mod) } $webApp.Update() $webApp.WebService. ApplyWebConfigModifications() Then create a csv file with your configs like so Name,Path,Owner,Type,Value system. ServiceModel,configuration,alinean-common,EnsureSection, connectionStrings,configuration,alinean-common,EnsureSection, appSettings,configuration,alinean-common,EnsureSection, serviceHostingEnvironment,configuration/system.
ServiceModel,alinean-common,EnsureChildNode, Then in another ps1 script, ideally the one you use to deploy your solution, import the csv config options and call the function created in the first code block: #read config mods from CSVs $mods = Import-CSV . \config\admin-common.webconfigmods. Csv Write-Host "Applying configuration modifications" #add web config mods to sharepoint using powershell script &.
\AddWebConfigMods "sharepoint site url" $mods &stsadm -o execadmsvcjobs.
Thanks for the detailed post. I'll try this out. – Wallace Breza Aug 10 '10 at 15:49 This all looks great and I'm sure it will work.
But it's still an additional step. Ideally I'd like everything to be bundled within my 1 wsp package for easy client deployment. – Wallace Breza Aug 10 '10 at 19:22 If it helps, you only need to run the script once.
Afterwhich each time you upgrade the wsp, SharePoint apply's the web config modifications for you. I hear what your saying though and hopefully someone else can chime in with a better solution. – Russ Aug 10 '10 at 21:56.
I believe this will help you out. Using WebConfigModifications are remembered by SharePoint and are automatically written to the physical web. Config files for you thus being easy to maintain across multiple deployed sites.
Thanks for the link. The most popular answer on that post recommends an add-in solution. Looks interesting, but I'd still rather have my config changes deployed with my app at the same time.
– Wallace Breza Aug 10 '10 at 15:09 The link just references a front-end add-on to make it easy to manage WebConfigModifications. I personally manage them using a few PS1 scripts and a csv formatted list of the config options. I'll include an example below.
– Russ Aug 10 '10 at 15:22.
Russ is correct, you need to use WebConfigModifications. Here is another resource that just uses plain code.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.