2
votes

I'm trying to add a new config section to our SF app configuration and it is failing:

Register-ServiceFabricApplicationType : The Settings section with name 'Blah' in ConfigOverride 'Config' is invalid. Cannot find a section with the same name.

Nothing fancy, done this many times before but I'm doing something wrong and I don't see.

<ApplicationManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ApplicationTypeName="eBenefits.OrganizationDomainType" ApplicationTypeVersion="1.0.0" xmlns="http://schemas.microsoft.com/2011/01/fabric">
    <Parameters>
        <Parameter Name="Parameter1" DefaultValue="" />
        <Parameter Name="Parameter2" DefaultValue="" />
        <Parameter Name="Parameter3" DefaultValue="" />
    </Parameters>
    <ConfigOverrides>
        <ConfigOverride Name="Config">
            <Settings>
                ...
                <Section Name="Blah">
                    <Parameter Name="Parameter1" Value="[Parameter1]" />
                    <Parameter Name="Parameter2" Value="[Parameter1]" />
                    <Parameter Name="Parameter3" Value="[Parameter1]" />
                </Section>
            </Settings>
        </ConfigOverride>
    </ConfigOverrides>
    ...
</ApplicationManifest>

Copying application to image store... Upload to Image Store succeeded Registering application type... Register-ServiceFabricApplicationType : The Settings section with name 'Blah' in ConfigOverride 'Config' is invalid. Cannot find a section with the same name. FileName: C:\SfDevCluster\Data\ImageBuilderProxy\AppType\a2b68765-272d-4477-aad2-f3d4818365c7\ApplicationManifest.xml At C:\Program Files\Microsoft SDKs\Service Fabric\Tools\PSModule\ServiceFabricSDK\Publish-NewServiceFabricApplication.ps1:251 char:9 + Register-ServiceFabricApplicationType -ApplicationPathInImage ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (Microsoft.Servi...usterConnection:ClusterConnection) [Register-Servic eFabricApplicationType], FabricException + FullyQualifiedErrorId : RegisterApplicationTypeErrorId,Microsoft.ServiceFabric.Powershell.RegisterApplicationTyp e

Finished executing script 'Deploy-FabricApplication.ps1'. Time elapsed: 00:00:39.7598137 The PowerShell script failed to execute.

2

2 Answers

3
votes

I forgot to define it in My-Service\PackageRoot\Config\Settings.xml

Reference: Full instructions on adding SF settings

0
votes

For anyone else who encountered this issue and already have Settings.xml files, you may wish to create a new Settings.xml using the Visual Studio context menu (new xml file) and get rid of the previous one after copying its contents across. For whatever reason Visual Studio did not recognise that I had a Settings.xml file and thus SF was unable to access it. Two Settings.xml files displayed by Visual Studio, but only one is detected which explains why homonymous files can exist in same folder

After doing this everything works.