I'm trying to host WebAPI service on local ServiceFabric cluster. However, I'm unable to start even a simple Web Api template provided by VS2017.
I did the following:
I prepared the environment: https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-get-started
I created a new project in Visual Studio, choosing "Service Fabric Application", and "Stateless Web API" service template
When I build it, and click run, it tries to deploy it but I get the following error:
Screen1
And the output is:
2>Copying application to image store... 2>Copy application
package succeeded 2>Registering application type...
2>Register-ServiceFabricApplicationType : Operation timed out.
2>At C:\Program Files\Microsoft SDKs\Service
Fabric\Tools\PSModule\ServiceFabricS
2>DK\Publish-NewServiceFabricApplication.ps1:251 char:9 2>+
Register-ServiceFabricApplicationType -ApplicationPathInImage ...
2>+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2>
+ CategoryInfo : OperationTimeout: (Microsoft.Servi...usterConnection:ClusterConnection)
[Register-ServiceFabricApplicationType], TimeoutException 2> +
FullyQualifiedErrorId :
RegisterApplicationTypeErrorId,Microsoft.Service 2>
Fabric.Powershell.RegisterApplicationType 2>Finished executing
script 'Deploy-FabricApplication.ps1'. 2>Time elapsed:
00:02:01.7559509 2>The PowerShell script failed to execute.
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
The interesting part is that when I choose basic "Stateless Service" template in Visual Studio, it works just fine. The problem I have is related to Web Api service on SF. My assumption is that the Web Api project has to write some additional info somewhere on the disk but does not have access to that path.
I tried reinstalling SF and SF SDK but with no results. I'm running VS2017 as an Administrator.
Any help greatly appreciated.
Related
Our company is starting with Service Fabric Microservices.
We install the Azure Service Fabric SDK as the MS documentation says (https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-get-started). We install it from de WebPI, open the powershell as admin, and run the "Set-ExecutionPolicy" comand.
Later we install the Azure tools in Visual Studio and with that we could create an example project, an Stateless project.
Inmediatly after the project loaded all the dependencies, we "start" the project. (VS ran as admin)
The VS sets the local cluster with 1 node and deploy the microservice. Until this point everythings was OK.
Then we create another Stateless project and we did the same things. But, this time we got and error in the output console of VS and in Service Fabric Explorer.
2>Started executing script 'Deploy-FabricApplication.ps1'.
2>powershell -NonInteractive -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -Command ". 'C:\Users\xxxxx\source\repos\Application2\Application2\Scripts\Deploy-FabricApplication.ps1' -ApplicationPackagePath
'C:\Users\xxxxx\source\repos\Application2\Application2\pkg\Debug' -PublishProfileFile
'C:\Users\xxxx\source\repos\Application2\Application2\PublishProfiles\Local.1Node.xml' -DeployOnly:$true -ApplicationParameter:#{_WFDebugParams_='[{"""CodePackageName""":"""Code""","""CodePackageLinkFolder""":"""C:\\Users\\xxxx\\source\\repos\\Application2\\Actor1\\bin\\Debug\\netcoreapp3.0\\win7-
x64""","""ConfigPackageName""":"""Config""","""ConfigPackageLinkFolder""":"""C:\\Users\\xxx\\source\\repos\\Application2\\Actor1\\PackageRoot\\Config""","""DataPackageName""":null,"""DataPackageLinkFolder""":null,"""LockFile""":"""C:\\Users\\xxxx\\source\\repos\\Application2\\Actor1\\bin\\Debug\\netcoreapp3.0\\win7-x64\\_VS_ServiceFabric_lock.txt""","""WorkingFolder""":"""C:\\Users\\xxxx\\source\\repos\\Application2\\Actor1""","""ServiceManifestName""":"""Actor1Pkg""",
"""EntryPointType""":"""Main""","""DebugExePath""":null,"""DebugArguments""":null,"""DebugParametersFile""":"""C:\\Users\\xxx\\source\\repos\\Application2\\
Actor1\\bin\\Debug\\netcoreapp3.0\\win7-x64\\_VS_ServiceFabric_debug.txt"""}]'} -
UnregisterUnusedApplicationVersionsAfterUpgrade $false -
OverrideUpgradeBehavior 'None' -OverwriteBehavior 'Always' -
SkipPackageValidation:$true -ErrorAction Stop"
2>Copying application to image store...
2>Upload to Image Store succeeded
2>Registering application type...
2>Register application type started. Use Get-ServiceFabricApplicationType to query for status.
2>Running Image Builder process ...
2>Downloading application package from 'Application2Type' ...
2>Validating package and computing checksums ...
2>FABRIC_E_IMAGEBUILDER_UNEXPECTED_ERROR: Se han producido uno o varios errores. --> AggregateException: Se han producido uno o varios errores. --> FileLoadException: El proceso no tiene acceso al archivo porque est siendo utilizado por otro proceso. (Excepci¢n de HRESULT: 0x80070020)
2>Registration of application type failed.
2>En C:\Program Files\Microsoft SDKs\Service
2>Fabric\Tools\PSModule\ServiceFabricSDK\Publish-NewServiceFabricApplication.ps1: 308 Car cter: 17
2>+ throw "Registration of application type failed."
2>+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2> + CategoryInfo : OperationStopped: (Registration of application type failed.:String) [], RuntimeException
2> + FullyQualifiedErrorId : Registration of application type failed.
2>
2>Finished executing script 'Deploy-FabricApplication.ps1'.
2>Time elapsed: 00:00:13.0719235
2>The PowerShell script failed to execute.
========== Build: 1 succeeded, 0 failed, 2 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
We reseted the cluster and tried to deploy the 2 examples again, but we got the same error for the two microservices.
I was looking for a solution in Google, MS Docs and here, but no one has a solution.
According to your log powershel can't get access to some process. As a very wide guess it could be a problem with an antivirus or your first debug session.
Have you tried not to debug(start vs), but to publish solution (Deploy project->right click-> publish) after cluster reset\restart?
Visual Studio 2015.update3 - fully updated & patched - windows 8.1 - .net 4.7.1
2>------ Publish started: Project: Prometheus, Configuration: Release x64 ------
2>Connecting to C:\Temp\publish...
2>Project "test.csproj" (GatherAllFilesToPublish target(s)):
2> Building with tools version "14.0".
2> Target "ValidateMSBuildToolsVersion" skipped. Previously built unsuccessfully.
2>Done building project "test.csproj" -- FAILED.
2>
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, **1 failed**, 0 skipped ==========
I have searched and tried every solution online - no joy. Have spent over 3 days trying to sort this out - getting super frustrated now. It appears to build fine but always fails to publish to a local folder on the pc.
Hoping someone can point me in the right direction.
Note: I have tried Any CPU, Debug, and Release configurations - all end the same. I have configured the build to output diagnostic information which is available on request.
I have a WCF web service using Visual Studio 2015. If I have a compile error in C# code, when I publish the web service (to a file location) the "build" will succeed, and continue through a successful publish:
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Publish: 1 succeeded, 0 failed, 0 skipped ==========
If I then deploy to an IIS web server and call the web service there, the call fails and returns a page describing the compilation error.
When publishing, the output in VS starts with Build started: but apparently it isn't really doing a build because any build would have failed, and in fact if I do a build instead of publish, it does report the error(s). Do I have to remember to build before publishing to check for errors, or is there a way to get it to really for realz compile the code?
If solution has many projects then try building them one at a time.
Try below steps:
Restart Visual Studio.
Restart Computer
Rebuild all
Clean Solution then Rebuild All
Also you can check below
Setting the MSBuild project build output verbosity (in Options > Projects and Solutions > Build and Run setting area) to "Diagnostic" as shown below. This then showed that the custom action was what had failed.
https://blogs.msdn.microsoft.com/saraford/2008/10/07/did-you-know-you-can-configure-the-msbuild-verbosity-in-the-output-window-329/
I' trying to publish ClickOnce Application to a webserver through sftp (Using Visual Studio 2015. The server is Centos 6.7).
My final config in the Publish Wizard:
The application will be published to:
sftp://10.1.0.88/home/www/sample/web/desktop/
Users will launch this application from:
http://sample.example.com/desktop/
When I published: (Output)
Connecting to 'sftp://10.1.0.88/home/www/sample/web/desktop/'...
Publishing files...
Publish success.
Warning: Unable to view published application at http://sample.example.com/desktop/publish.htm.
http://sample.example.com/desktop/publish.htm
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Publish: 1 succeeded, 0 failed, 0 skipped ==========
Nothing was added in /home/www/sample/web/desktop/. But it says Publish success.
What should I do?
It turned out the deployment files were added to /root/home/www/sample/web/desktop/instead of /home/www/sample/web/desktop/
So I change publishing folder location from
sftp://10.1.0.88/home/www/sample/web/desktop/
to
sftp://10.1.0.88/../home/www/ecr/web/desktop/
I have a complex lightswitch application that was created using visual studio 2013, and then I upgrade it to using visual studio 2015. the solution was working fine, I even did a couple of deployment for it. Now I am trying to build it from a new machine and the build hangs (it never finishes). The output console is displaying an error: Microsoft.Lightswitch.Build.Tasks.Targets(168,5): application definition contains critical errors
I tried Google for a solution but could not find one that works in my case, I already checked the Link1 and this one Link2
When I cancel the build another similar error is displayed this is the output console:
------ Build started: Project: Agency Tool.Server, Configuration: Debug Any CPU ------
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\LightSwitch\v5.0\Microsoft.LightSwitch.Build.Tasks.targets(168,5): error : Application definition contains critical errors.
------ Build started: Project: Agency Tool.DesktopClient, Configuration: Debug Any CPU ------
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\LightSwitch\v5.0\Microsoft.LightSwitch.Build.Tasks.targets(217,5): error : Application definition contains critical errors.
------ Build started: Project: Agency Tool, Configuration: Debug Any CPU ------
The data necessary to complete this operation is not yet available. (Exception from HRESULT: 0x8000000A)
========== Build: 0 succeeded, 3 failed, 0 up-to-date, 0 skipped ==========
Resolved:
We noticed that in the main project properties--> extensions tab, Microsoft Lightswitch Extensions was not selected (I don't know what caused it to be unchecked, but I did not do it manually). However when we checked it the error disappeared.