脚本失败,错误为 Microsoft.ServiceFabric.Internal.Strings.dll 在安装 "Microsoft Service Fabric" 时不可用



升级到最新的工具、运行时和 SDK (5.5.216.0) 后,PowerShell 脚本(如 TestConfiguration.ps1)失败,并显示找不到 Microsoft.ServiceFabric.Internal.Strings.dll版本 5.0.0.0 的错误。一旦我从控制面板中卸载"Microsoft Service Fabric",它就可以正常工作。此行为似乎与 5.5.216.0 中解决的 Newtonsoft.Json.dll 问题非常相似,只是这次使用了不同的程序集。

这是一个已知问题吗?

当我运行某些脚本时,必须卸载"Microsoft Service Fabric",然后必须为需要它的其他脚本再次安装它,这很快就会变得乏味。

错误示例:

PS C:\git\sf-admin\DeploymentScripts\Microsoft.Azure.ServiceFabric.WindowsServer> .\TestConfiguration.ps1 ..\ClusterConfig.Production.Shared.json 跟踪文件夹不存在。创建跟踪文件夹:C:\git\sf-admin\DeploymentScripts\Microsoft.Azure.ServiceFabric.WindowsServer\DeploymentTraces 正在运行最佳做法分析器... 找不到与包相关的独立文件。检查包结构。错误:System.IO.FileNotFound异常:无法加载文件或程序集"Microsoft.ServiceFabric.Internal.Strings,版本=5.0.0.0,区域性=中性,公钥令牌=31bf3856ad364e35"或打开 e 的依赖关系。系统找不到指定的文件。 文件名:"Microsoft.ServiceFabric.Internal.Strings, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" at Microsoft.ServiceFabric.ClusterManagementCommon.ValidatorExtensions.ThrowValidationExceptionIfNull[T](T parameter, String parameterName) at Microsoft.ServiceFabric.DeploymentManager.BPA.BestPracticesAnalyzer.IsJsonConfigModelValid(StandAloneInstallerJsonModelBase config)

谢谢 汉斯

我相信由于SDK/运行时将dll安装到正在拾取的GAC而出现该错误。

尝试运行将Microsoft.Azure.ServiceFabric.WindowsServer文件夹移动到另一台计算机并再次运行TestConfiguration.ps1。

如果您从无法访问互联网的机器上运行脚本,则需要指定包含运行时的.cab的位置

-FabricRuntimePackagePath C:tempMicrosoft.Azure.ServiceFabric.WindowsServer.5.5.216.0MicrosoftAzureServiceFabric5.5.216.0.cab

相关内容

最新更新