- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在尝试像这样升级我的应用程序:
失败并出现以下错误:
错误详情:
2>Test-ServiceFabricApplicationPackage : The BuildLayout of the application in
2>C:\Users\me\AppData\Local\Temp\TestApplicationPackage_2205895293421\4myc2vpp.bdq\Debug is invalid. Code is
2>missing for service MyServicePkg.
2>At C:\Program Files\Microsoft SDKs\Service
2>Fabric\Tools\PSModule\ServiceFabricSDK\Publish-UpgradedServiceFabricApplication.ps1:135 char:38
2>+ ... nSuccess = (Test-ServiceFabricApplicationPackage $AppPkgPathToUse -Im ...
2>+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2> + CategoryInfo : InvalidOperation: (:) [Test-ServiceFabricApplicationPackage], FabricImageBuilderValidati
2> onException
2> + FullyQualifiedErrorId : TestApplicationPackageErrorId,Microsoft.ServiceFabric.Powershell.TestApplicationPackage2>
2>Finished executing script 'Deploy-FabricApplication.ps1'.
2>Time elapsed: 00:00:40.4035177
2>The PowerShell script failed to execute.
========== Build: 1 succeeded, 0 failed, 46 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
这是我为该特定项目设置的属性:
最佳答案
我同意 Hans Passant 的评论:
The most basic mishap is that the name you used in the ServiceManifest.xml file does not match the name of the .exe that your project generates
它在您的调试输出中也可见,因为构建成功但发布失败。
========== Build: 1 succeeded, 0 failed, 46 up-to-date, 0 skipped ========== ========== Publish: 0 succeeded, 1 failed, 0 skipped ==========
它可能以多种方式发生,很可能是由于重命名项目或重命名程序集名称
。如果您重命名项目或项目的 Assembly Name
,您的构建可执行文件将根据该名称。考虑以下情况。
我将 Assembly Name
从“MyService”重命名为“MyRenamedService”。因此构建可执行文件将是 MyRenamedService.exe
。因此,您必须在 ServiceManifest.xml
中进行设置。
<CodePackage Name="Code" Version="1.0.0">
<EntryPoint>
<ExeHost>
<Program>MyRenamedService.exe</Program>
<WorkingFolder>CodePackage</WorkingFolder>
</ExeHost>
</EntryPoint>
</CodePackage>
确定构建可执行路径的最佳方法是构建解决方案。它将在输出窗口中显示可执行文件的完整路径。
1>------ Build started: Project: Web1, Configuration: Debug Any CPU ------
1>Web1 -> C:\.....\Application2\Web1\bin\Debug\net461\win7-x64\MyRenamedService.exe
2>------ Build started: Project: Application2, Configuration: Debug x64 ------
========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
这里的Web1
是我开始的Project Name,MyRenamedService.exe
是build executable name(因为我重命名了Assembly Name),应该在ServiceManifest.xml
如上所示。
关于c# - 服务 MyServicePkg 缺少代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48772069/
我正在尝试像这样升级我的应用程序: 失败并出现以下错误: 错误详情: 2>Test-ServiceFabricApplicationPackage : The BuildLayout of the a
我是一名优秀的程序员,十分优秀!