Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

New-ServiceFabricApplication : Application type and version not found

I have Visual Studio 2017 and I about to start working with Azure-Service-Fabric (C#).

Just created an Azure Service Fabric application, with stateless service and try to run it. Empty project. No changes on the code-template.

I'm getting this message on the output window:

Creating application...
New-ServiceFabricApplication : Application type and version not found
At C:\Program Files\Microsoft SDKs\Service 
Fabric\Tools\PSModule\ServiceFabricSDK\Publish-NewServiceFabricApplication.ps1:358 char:9
+         New-ServiceFabricApplication -ApplicationName $ApplicationNam ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (Microsoft.Servi...usterConnection:ClusterConnection) [New-ServiceFabr 
   icApplication], FabricElementNotFoundException
    + FullyQualifiedErrorId : CreateApplicationInstanceErrorId,Microsoft.ServiceFabric.Powershell.NewApplication

Finished executing script 'Publish-NewServiceFabricApplication'.
Time elapsed: 00:00:07.4935602

The projects build is passed successfully. Starting to run and then stopped. No other indication to problem except the output window.

What I missing? How to fix?

like image 549
No1Lives4Ever Avatar asked May 27 '18 13:05

No1Lives4Ever


2 Answers

Found the problem.

Just change the Azure-Service-Project configuration from "Any CPU" to "x64". Now it's working!

(Don't forget to run it in "Administrator" mode)

like image 158
No1Lives4Ever Avatar answered Sep 27 '22 23:09

No1Lives4Ever


Publish-NewServiceFabricApplication.ps1 script takes the application type and version from the ApplicationManifest.xml of your service fabric application. Please check if you have this file and if the second line has ApplicationTypeVersion and ApplicationTypeName specified. It should look similar to this:

<ApplicationManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ApplicationTypeName="MyAppType" ApplicationTypeVersion="1.0.0" xmlns="http://schemas.microsoft.com/2011/01/fabric">

like image 20
SteppingRazor Avatar answered Sep 27 '22 23:09

SteppingRazor