3

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.

spottedmahn
  • 14,823
  • 13
  • 108
  • 178

2 Answers2

3

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

Reference: Full instructions on adding SF settings

spottedmahn
  • 14,823
  • 13
  • 108
  • 178
  • I have this same error except that I have defined it in my Settings.xml file. I guess that the Settings.xml file is not being found. I wonder if there is some more ceremony beyond adding the service reference/s to the SF application project and updating the service project.json files. – Shooresh Oct 20 '18 at 16:11
0

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.

Shooresh
  • 105
  • 1
  • 11
  • Might be too late now but I wonder what the build property was set to? That’s caused me problems in the past with other project types, no SF specifically though. – spottedmahn Oct 20 '18 at 19:14
  • Hi - Do you mean in the config manager: Debug | Any CPU | Build checked. I was receiving other errors too but I had to set the CPU spec in the project.json as well as add a property to specify it is an SF service. On this issue, I think it is an edge case but still serious as I only resolved it by chance. In the cold light of day I have analysed what I did. I migrated the app to Core 2, had created shell projects and copy pasted the folder contents, including the Settings.xml in 3 of 4 cases; the 4th case: service project created with the SF application - this had no such problems. – Shooresh Oct 21 '18 at 15:04
  • Hi - I mean F4 on the file (which brings up the properties window) -> Build Action – spottedmahn Oct 21 '18 at 15:48