Service Fabric SetupEntryPoint

后端 未结 3 1484
后悔当初
后悔当初 2021-02-10 02:04

I have a Guest Executable that needs to access a shared drive (Azure Files). My guest executable is setup in of the ServiceManifest.xml. I\'ve tried adding a to launch a \"mys

3条回答
  •  后悔当初
    2021-02-10 02:51

    In my case I solved the error: "CodePackageActivation:Code:SetupEntryPoint There was an error during CodePackage activation.The service host terminated with exit code:1"

    by moving my setup script to a ps1 file and executing it from the MySetup.bat

    So I ended it up with the following in my .bat and .ps1 files.

    1. In my MySetup.bat (the one you reference in the service manifest):

    powershell.exe -ExecutionPolicy Bypass -Command ".\MySetup.ps1"

    1. In my MySetup.ps1 (add your own PowerShell script here):

    netsh http add urlacl url=http://erick1.com:80/ user="NT AUTHORITY\NETWORK SERVICE"

    How to debug:

    Remote Desktop your Virtual Machine and go to "D:\SvcFab_App[YOUR SERVCE TYPE NAME HERE]\log" and check the .err and .out files. Don't forget to add to your service manifest.. the entire section would be:

    
      
        MySetup.bat
        CodePackage
        
      
    
    

    One last thing: In my case I had a special char in the .bat file that was not visible in Visual Studio and my setup was failing... I was only able to discovery it by reading the logs ( described above ). Don't be afraid of logs, it's usually one line in this case.

    Thanks

提交回复
热议问题