ConfigOverride 'Config' 中名称为 'Blah' 的设置部分无效。找不到同名的部分

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

我正在尝试向我们的 SF 应用配置添加一个新的配置部分,但它失败了:

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

没什么特别的,以前做过很多次,但我做错了,我没看到。

<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.

忘记在My-Service\PackageRoot\Config\Settings.xml

中定义了

参考:

对于遇到此问题并且已经有 Settings.xml 个文件的任何其他人,您可能希望使用 Visual Studio 上下文菜单创建一个新的 Settings.xml(新的 xml文件)并在复制其内容后删除前一个文件。出于某种原因 Visual Studio 无法识别我有一个 Settings.xml 文件,因此 SF 无法访问它。

完成后一切正常。