Service Fabric 应用程序部署不创建服务
Service Fabric App Deployment Not Creating Service
当我通过 Visual Studio 2017 将我的服务结构应用程序部署到我的本地集群时,我的服务是 not created .我必须手动进入 Service Fabric Explorer
并 单击创建 。为什么?
背景: 我做了一些项目重命名和移动文件夹。我认为这打破了它过去的工作方式。
Service Fabric 工具的输出 Window
Started executing script 'Publish-NewServiceFabricApplication'.
[void](Connect-ServiceFabricCluster); Import-Module 'C:\Program Files\Microsoft SDKs\Service Fabric\Tools\PSModule\ServiceFabricSDK\ServiceFabricSDK.psm1'; Publish-NewServiceFabricApplication -ApplicationPackagePath 'C:\Users\mdepouw\source\repos\The Repo\TheProject.IdentityDomain\TheProject.Identity.App\pkg\Debug' -ApplicationParameterFilePath 'C:\Users\mdepouw\source\repos\The Repo\TheProject.IdentityDomain\TheProject.Identity.App\PublishProfiles\..\ApplicationParameters\Local.5Node.xml' -ApplicationParameter @{_WFDebugParams_='[{"""CodePackageName""":"""Code""","""CodePackageLinkFolder""":null,"""ConfigPackageName""":null,"""ConfigPackageLinkFolder""":null,"""DataPackageName""":null,"""DataPackageLinkFolder""":null,"""LockFile""":null,"""WorkingFolder""":null,"""ServiceManifestName""":"""IdentityServicePkg""","""EntryPointType""":"""Main""","""DebugExePath""":"""C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Packages\Debugger\VsDebugLaunchNotify.exe""","""DebugArguments""":""" {83288f71-0cb5-49bc-b56b-f212d6fc8486} -p [ProcessId] -tid [ThreadId]""","""DebugParametersFile""":null}]'} -Action Create -SkipPackageValidation:$true -ErrorAction Stop
Creating application...
ApplicationName : fabric:/IdentityApp
ApplicationTypeName : IdentityAppType
ApplicationTypeVersion : 1.0.0
ApplicationParameters : { "_WFDebugParams_" = "[{"CodePackageName":"Code","CodePackageLinkFolder":null,"ConfigPackageN
ame":null,"ConfigPackageLinkFolder":null,"DataPackageName":null,"DataPackageLinkFolder":null,"
LockFile":null,"WorkingFolder":null,"ServiceManifestName":"IdentityServicePkg","EntryPointType
":"Main","DebugExePath":"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\C
ommon7\Packages\Debugger\VsDebugLaunchNotify.exe","DebugArguments":"
{83288f71-0cb5-49bc-b56b-f212d6fc8486} -p [ProcessId] -tid
[ThreadId]","DebugParametersFile":null}]" }
Create application succeeded.
Finished executing script 'Publish-NewServiceFabricApplication'.
Time elapsed: 00:00:07.2779519
Started executing script 'Get-ServiceFabricApplicationStatus'.
[void](Connect-ServiceFabricCluster); Import-Module 'C:\Program Files\Microsoft SDKs\Service Fabric\Tools\PSModule\ServiceFabricSDK\ServiceFabricSDK.psm1'; Get-ServiceFabricApplicationStatus -ApplicationName 'fabric:/IdentityApp' -ErrorAction Stop
The application has started.
Service Status:
The application is ready.
Finished executing script 'Get-ServiceFabricApplicationStatus'.
Time elapsed: 00:00:04.7490158
Launching the browser with URL https://localhost:44300/ to open the application.Started executing script 'Unpublish-ServiceFabricApplication'.
[void](Connect-ServiceFabricCluster); Import-Module 'C:\Program Files\Microsoft SDKs\Service Fabric\Tools\PSModule\ServiceFabricSDK\ServiceFabricSDK.psm1'; Unpublish-ServiceFabricApplication -ApplicationName 'fabric:/IdentityApp' -ErrorAction Stop
Removing application...
Remove application instance succeeded
Finished executing script 'Unpublish-ServiceFabricApplication'.
Time elapsed: 00:00:08.9813491
Started executing script 'UnregisterApplicationType'.
[void](Connect-ServiceFabricCluster); Import-Module 'C:\Program Files\Microsoft SDKs\Service Fabric\Tools\PSModule\ServiceFabricSDK\ServiceFabricSDK.psm1'; if (Get-ServiceFabricApplicationType -ApplicationTypeName 'IdentityAppType' | Where-Object { $_.ApplicationTypeVersion -eq '1.0.0' }) { Unregister-ServiceFabricApplicationType -ApplicationTypeName 'IdentityAppType' -ApplicationTypeVersion '1.0.0' -ErrorAction Stop -Force }
Unregister application type succeeded.
Finished executing script 'UnregisterApplicationType'.
Time elapsed: 00:00:07.9996788
Launching the browser with URL https://localhost:44300/ to open the application.
在 ApplicationManifest.xml
中,我必须定义我想要的 <DefaultServices>
:
<DefaultServices>
<!-- The section below creates instances of service types, when an instance of this
application type is created. You can also create one or more instances of service type using the
ServiceFabric PowerShell module.
The attribute ServiceTypeName below must match the name defined in the imported ServiceManifest.xml file. -->
<Service Name="Identity">
<StatelessService ServiceTypeName="IdentityService" InstanceCount="[Identity_InstanceCount]">
<SingletonPartition />
</StatelessService>
</Service>
</DefaultServices>
当我通过 Visual Studio 2017 将我的服务结构应用程序部署到我的本地集群时,我的服务是 not created .我必须手动进入 Service Fabric Explorer
并 单击创建 。为什么?
背景: 我做了一些项目重命名和移动文件夹。我认为这打破了它过去的工作方式。
Service Fabric 工具的输出 Window
Started executing script 'Publish-NewServiceFabricApplication'.
[void](Connect-ServiceFabricCluster); Import-Module 'C:\Program Files\Microsoft SDKs\Service Fabric\Tools\PSModule\ServiceFabricSDK\ServiceFabricSDK.psm1'; Publish-NewServiceFabricApplication -ApplicationPackagePath 'C:\Users\mdepouw\source\repos\The Repo\TheProject.IdentityDomain\TheProject.Identity.App\pkg\Debug' -ApplicationParameterFilePath 'C:\Users\mdepouw\source\repos\The Repo\TheProject.IdentityDomain\TheProject.Identity.App\PublishProfiles\..\ApplicationParameters\Local.5Node.xml' -ApplicationParameter @{_WFDebugParams_='[{"""CodePackageName""":"""Code""","""CodePackageLinkFolder""":null,"""ConfigPackageName""":null,"""ConfigPackageLinkFolder""":null,"""DataPackageName""":null,"""DataPackageLinkFolder""":null,"""LockFile""":null,"""WorkingFolder""":null,"""ServiceManifestName""":"""IdentityServicePkg""","""EntryPointType""":"""Main""","""DebugExePath""":"""C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Packages\Debugger\VsDebugLaunchNotify.exe""","""DebugArguments""":""" {83288f71-0cb5-49bc-b56b-f212d6fc8486} -p [ProcessId] -tid [ThreadId]""","""DebugParametersFile""":null}]'} -Action Create -SkipPackageValidation:$true -ErrorAction Stop
Creating application...
ApplicationName : fabric:/IdentityApp
ApplicationTypeName : IdentityAppType
ApplicationTypeVersion : 1.0.0
ApplicationParameters : { "_WFDebugParams_" = "[{"CodePackageName":"Code","CodePackageLinkFolder":null,"ConfigPackageN
ame":null,"ConfigPackageLinkFolder":null,"DataPackageName":null,"DataPackageLinkFolder":null,"
LockFile":null,"WorkingFolder":null,"ServiceManifestName":"IdentityServicePkg","EntryPointType
":"Main","DebugExePath":"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\C
ommon7\Packages\Debugger\VsDebugLaunchNotify.exe","DebugArguments":"
{83288f71-0cb5-49bc-b56b-f212d6fc8486} -p [ProcessId] -tid
[ThreadId]","DebugParametersFile":null}]" }
Create application succeeded.
Finished executing script 'Publish-NewServiceFabricApplication'.
Time elapsed: 00:00:07.2779519
Started executing script 'Get-ServiceFabricApplicationStatus'.
[void](Connect-ServiceFabricCluster); Import-Module 'C:\Program Files\Microsoft SDKs\Service Fabric\Tools\PSModule\ServiceFabricSDK\ServiceFabricSDK.psm1'; Get-ServiceFabricApplicationStatus -ApplicationName 'fabric:/IdentityApp' -ErrorAction Stop
The application has started.
Service Status:
The application is ready.
Finished executing script 'Get-ServiceFabricApplicationStatus'.
Time elapsed: 00:00:04.7490158
Launching the browser with URL https://localhost:44300/ to open the application.Started executing script 'Unpublish-ServiceFabricApplication'.
[void](Connect-ServiceFabricCluster); Import-Module 'C:\Program Files\Microsoft SDKs\Service Fabric\Tools\PSModule\ServiceFabricSDK\ServiceFabricSDK.psm1'; Unpublish-ServiceFabricApplication -ApplicationName 'fabric:/IdentityApp' -ErrorAction Stop
Removing application...
Remove application instance succeeded
Finished executing script 'Unpublish-ServiceFabricApplication'.
Time elapsed: 00:00:08.9813491
Started executing script 'UnregisterApplicationType'.
[void](Connect-ServiceFabricCluster); Import-Module 'C:\Program Files\Microsoft SDKs\Service Fabric\Tools\PSModule\ServiceFabricSDK\ServiceFabricSDK.psm1'; if (Get-ServiceFabricApplicationType -ApplicationTypeName 'IdentityAppType' | Where-Object { $_.ApplicationTypeVersion -eq '1.0.0' }) { Unregister-ServiceFabricApplicationType -ApplicationTypeName 'IdentityAppType' -ApplicationTypeVersion '1.0.0' -ErrorAction Stop -Force }
Unregister application type succeeded.
Finished executing script 'UnregisterApplicationType'.
Time elapsed: 00:00:07.9996788
Launching the browser with URL https://localhost:44300/ to open the application.
在 ApplicationManifest.xml
中,我必须定义我想要的 <DefaultServices>
:
<DefaultServices>
<!-- The section below creates instances of service types, when an instance of this
application type is created. You can also create one or more instances of service type using the
ServiceFabric PowerShell module.
The attribute ServiceTypeName below must match the name defined in the imported ServiceManifest.xml file. -->
<Service Name="Identity">
<StatelessService ServiceTypeName="IdentityService" InstanceCount="[Identity_InstanceCount]">
<SingletonPartition />
</StatelessService>
</Service>
</DefaultServices>