【问题标题】:Duplicate parameters are not allowed with Azure Service FabricAzure Service Fabric 不允许使用重复的参数
【发布时间】:2017-01-30 03:41:30
【问题描述】:

我正在尝试在 Visual Studio 2015 中构建一个 Service Fabric 项目。我有一个名为 Weather 的服务。当我尝试运行该项目时,我得到以下输出:

2>Started executing script 'Deploy-FabricApplication.ps1'.
2>. 'D:\InergySystems\GitHub\InSysServiceFabric\InSysServiceFabric\Scripts\Deploy-FabricApplication.ps1' -ApplicationPackagePath 'D:\InergySystems\GitHub\InSysServiceFabric\InSysServiceFabric\pkg\Debug' -PublishProfileFile 'D:\InergySystems\GitHub\InSysServiceFabric\InSysServiceFabric\PublishProfiles\Local.xml' -DeployOnly:$true -UnregisterUnusedApplicationVersionsAfterUpgrade $false -OverrideUpgradeBehavior 'None' -OverwriteBehavior 'Always' -SkipPackageValidation:$true -ErrorAction Stop
2>Copying application to image store...
2>Copy application package succeeded
2>Registering application type...
2>Register-ServiceFabricApplicationType : Parameter with the name 'Weather_InstanceCount' is found more than once. 
2>Duplicate parameters are not allowed.
2>FileName: C:\SfDevCluster\Data\ImageBuilderProxy\AppType\InSysServiceFabricType\ApplicationManifest.xml
2>At C:\Program Files\Microsoft SDKs\Service 
2>Fabric\Tools\PSModule\ServiceFabricSDK\Publish-NewServiceFabricApplication.ps1:237 char:9
2>+         Register-ServiceFabricApplicationType -ApplicationPathInImage ...
2>+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2>    + CategoryInfo          : InvalidOperation: (Microsoft.Servi...usterConnection:ClusterConnection) [Register-Servic 
2>   eFabricApplicationType], FabricException
2>    + FullyQualifiedErrorId : RegisterApplicationTypeErrorId,Microsoft.ServiceFabric.Powershell.RegisterApplicationTyp 
2>   e
2> 
2>Finished executing script 'Deploy-FabricApplication.ps1'.
2>Time elapsed: 00:00:06.7573145
2>The PowerShell script failed to execute.
========== Build: 1 succeeded, 0 failed, 6 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

关键部分似乎是:

2>Register-ServiceFabricApplicationType : Parameter with the name 'Weather_InstanceCount' is found more than once. 
2>Duplicate parameters are not allowed.

我已尝试重置并重新启动 Service Fabric(本地集群),但仍然出现相同的错误。

有什么想法吗?

很高兴提供更多信息,但之前没有使用过 SF,不确定哪些信息会有所帮助。

【问题讨论】:

  • 检查 ApplicationManifest.xml 并确保您没有设置 Weather_InstanceCount 参数两次
  • 就是这样,谢谢。由于某种原因(我没有故意添加它们),ApplicationManifest.xml 和 ApplicationParameters/Local.xml 中有双重条目。如果您添加一个,很高兴将其标记为答案。

标签: visual-studio azure azure-service-fabric


【解决方案1】:

答案在错误信息中:

Parameter with the name 'Weather_InstanceCount' is found more than once. 

检查您的 ApplicationManifest.xml - 您有两个同名的应用程序参数,这是不允许的。

【讨论】:

    【解决方案2】:

    如果您有一个与您的ApplicationManifest.xml 定义相同参数的StartupServices.xml 文件,也会发生此错误。

    在我的例子中,调试应用程序成功,但发布产生了这个错误。

    【讨论】:

      猜你喜欢
      • 2019-11-30
      • 2018-11-06
      • 1970-01-01
      • 2015-07-11
      • 2018-10-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-17
      相关资源
      最近更新 更多