FabActUtil.exe 以代码 -1 退出
FabActUtil.exe exits with code -1
我现在在包括 Service Fabric 包在内的所有构建中都收到以下错误:
build\Microsoft.ServiceFabric.Actors.targets(34,5):
error MSB3073: The command ""\Build\x64\Debug\FabActUtil.exe"
/app:"\ApplicationPackageRoot" /spp:"PackageRoot" /t:manifest /ap:"Project"
/sp:"Project1" /in:"..\Build\x64\Debug\Project1.Exe"
/local5nodeappparamfile:"ApplicationParameters\Local.5Node.xml"
/local1nodeappparamfile:"ApplicationParameters\Local.1Node.xml" "
exited with code -1.
运行 Service Fabric 5.2.207,SDK 2.2.207
FabActUtil.exe 的代码 -1 是什么?有什么方法可以在此事件上获得更好的错误输出?
运行 Visual Studio 之外的错误消息中的命令给出了以下带有堆栈跟踪的消息:
System.ArgumentException: An item with the same key has already been
added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource
resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key,
TValue value, Boolean add)
at Microsoft.ServiceFabric.Actors.Generator.ManifestGenerator.Context.LoadExistingContents()
at Microsoft.ServiceFabric.Actors.Generator.ManifestGenerator.Generate(Arguments arguments)
at FabActUtil.Tool.GenerateOutput(ToolContext context)
at FabActUtil.Program.Main(String[] args)
这是因为 ApplicationManifest.xml
对其中一项默认服务进行了重复定义。
感谢 amanbha:https://github.com/amanbha
如果您在使用 Service Fabric SDK 时遇到 FabActUtil.exe 错误。
如果 MS Build 打算使用 FabActUtil.exe 和目标文件构建服务结构参与者,并且发生 FabActUtil.exe 退出代码 -1 的错误。可以通过更改目标文件来修复错误。最简单的方法是使用旧的 Service Fabric SDK 的目标文件。
如果您的解决方案到目前为止 运行 正常,我认为您的解决方案根目录的 packages 文件夹中有一些 Microsoft.ServiceFabric.Actors 包。
如果你没有任何包运行宁正常,使用this target file of Microsoft.ServiceFabric.Actors.2.2.207. This file has differences与复制点出现错误的文件,运行然后删除FubActUtil.exe.
目标文件是:
%solution root%\packages\Microsoft.ServiceFabric.Actors.%version%\build\Microsoft.ServiceFabric.Actors.targets
与版本无关。
好吧,我从无法编译的项目中删除了 bin 文件夹,它成功了。
有同样的错误。在我的例子中,这是因为我重载了 Actor 方法。
不幸的是,这是不允许的。
重载是编码的一个非常重要的方面,尤其是在使用命令模式时。不知道为什么 SF Actors 不支持它。
另外,错误并没有说明问题的原因。我必须在我的代码中进行消除过程才能弄清楚
我现在在包括 Service Fabric 包在内的所有构建中都收到以下错误:
build\Microsoft.ServiceFabric.Actors.targets(34,5):
error MSB3073: The command ""\Build\x64\Debug\FabActUtil.exe"
/app:"\ApplicationPackageRoot" /spp:"PackageRoot" /t:manifest /ap:"Project"
/sp:"Project1" /in:"..\Build\x64\Debug\Project1.Exe"
/local5nodeappparamfile:"ApplicationParameters\Local.5Node.xml"
/local1nodeappparamfile:"ApplicationParameters\Local.1Node.xml" "
exited with code -1.
运行 Service Fabric 5.2.207,SDK 2.2.207
FabActUtil.exe 的代码 -1 是什么?有什么方法可以在此事件上获得更好的错误输出?
运行 Visual Studio 之外的错误消息中的命令给出了以下带有堆栈跟踪的消息:
System.ArgumentException: An item with the same key has already been
added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource
resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key,
TValue value, Boolean add)
at Microsoft.ServiceFabric.Actors.Generator.ManifestGenerator.Context.LoadExistingContents()
at Microsoft.ServiceFabric.Actors.Generator.ManifestGenerator.Generate(Arguments arguments)
at FabActUtil.Tool.GenerateOutput(ToolContext context)
at FabActUtil.Program.Main(String[] args)
这是因为 ApplicationManifest.xml
对其中一项默认服务进行了重复定义。
感谢 amanbha:https://github.com/amanbha
如果您在使用 Service Fabric SDK 时遇到 FabActUtil.exe 错误。 如果 MS Build 打算使用 FabActUtil.exe 和目标文件构建服务结构参与者,并且发生 FabActUtil.exe 退出代码 -1 的错误。可以通过更改目标文件来修复错误。最简单的方法是使用旧的 Service Fabric SDK 的目标文件。
如果您的解决方案到目前为止 运行 正常,我认为您的解决方案根目录的 packages 文件夹中有一些 Microsoft.ServiceFabric.Actors 包。
如果你没有任何包运行宁正常,使用this target file of Microsoft.ServiceFabric.Actors.2.2.207. This file has differences与复制点出现错误的文件,运行然后删除FubActUtil.exe.
目标文件是:
%solution root%\packages\Microsoft.ServiceFabric.Actors.%version%\build\Microsoft.ServiceFabric.Actors.targets
与版本无关。
好吧,我从无法编译的项目中删除了 bin 文件夹,它成功了。
有同样的错误。在我的例子中,这是因为我重载了 Actor 方法。 不幸的是,这是不允许的。
重载是编码的一个非常重要的方面,尤其是在使用命令模式时。不知道为什么 SF Actors 不支持它。
另外,错误并没有说明问题的原因。我必须在我的代码中进行消除过程才能弄清楚