Service Fabric: The EntryPoint Blah.exe is not found - azure-service-fabric

I did some project renaming and changed the folder structure and now I can't deploy my service fabric app to my local service fabric cluster.
Register-ServiceFabricApplicationType : The EntryPoint IdentityService.exe is not found.
The app was called IdentityApp and is now TheProject.Identity.App
The service was called IdentityWeb and is now TheProject.Identity.Service
More Log Details
Started executing script 'Deploy-FabricApplication.ps1'.
. 'C:\Users\mdepouw\source\repos\TheProject\TheProject.IdentityDomain\TheProject.Identity.App\Scripts\Deploy-FabricApplication.ps1' -ApplicationPackagePath 'C:\Users\mdepouw\source\repos\TheProject\TheProject.IdentityDomain\TheProject.Identity.App\pkg\Debug' -PublishProfileFile 'C:\Users\mdepouw\source\repos\TheProject\TheProject.IdentityDomain\TheProject.Identity.App\PublishProfiles\Local.5Node.xml' -DeployOnly:$true -ApplicationParameter:#{} -UnregisterUnusedApplicationVersionsAfterUpgrade $false -OverrideUpgradeBehavior 'None' -OverwriteBehavior 'Always' -SkipPackageValidation:$true -ErrorAction Stop
Copying application to image store...
Upload to Image Store succeeded
Registering application type...
Register-ServiceFabricApplicationType : The EntryPoint IdentityService.exe is not found.
FileName: C:\SfDevCluster\Data\ImageBuilderProxy\AppType\IdentityAppType\IdentityServicePkg\ServiceManifest.xml
At C:\Program Files\Microsoft SDKs\Service
Fabric\Tools\PSModule\ServiceFabricSDK\Publish-NewServiceFabricApplication.ps1:251 char:9
Register-ServiceFabricApplicationType -ApplicationPathInImage ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : InvalidOperation: (Microsoft.Servi...usterConnection:ClusterConnection) [Register-Servic
eFabricApplicationType], FabricException
FullyQualifiedErrorId : RegisterApplicationTypeErrorId,Microsoft.ServiceFabric.Powershell.RegisterApplicationType
Finished executing script 'Deploy-FabricApplication.ps1'.
Time elapsed: 00:00:26.1378123
The PowerShell script failed to execute.

In TheProject.Identity.Service\PackageRoot\ServiceManifest.xml I had to change the <Program> to match the new exe name
<!-- Code package is your service executable. -->
<CodePackage Name="Code" Version="1.0.0">
<EntryPoint>
<ExeHost>
<Program>TheProject.Identity.Service.exe</Program>
<WorkingFolder>CodePackage</WorkingFolder>
</ExeHost>
</EntryPoint>
</CodePackage>

I have also encounter this issue, i got the below two parameters was different in *.csproj file.
<AssemblyName>servicename</AssemblyName>
<RootNamespace>servicename</RootNamespace>
Maybe it might be helpful for somebody else.

I didn't rename services in my project, but I faced the same error couple of days ago. After a lot of time of deep into the issue, I got its reason finally.
I had this line in service's *.csproj file:
<SelfContained>false</SelfContained>
And after removing this string everything started working. I'm not sure why Azure's team didn't provide the much more obvious error in this case.
Maybe it might be helpful for somebody else.

Build configuration was wrong in my case, it was set to release for Debug.
Right click on the solution -> Configuration Manager, change to debug for your project

Even I faced the same problem . I updated the serviceManifest.xml as below and got the issue resolved
<CodePackage Name="Code" Version="1.0.0">
<SetupEntryPoint>
<ExeHost>
<Program>SetupEntryPointTasks.exe</Program>
<ConsoleRedirection FileRetentionCount="5" FileMaxSizeInKb="20480"/>
</ExeHost>
</SetupEntryPoint>
<EntryPoint>
<ExeHost>
<Program>aaa.exe</Program>
<ConsoleRedirection FileRetentionCount="5" FileMaxSizeInKb="20480" />
</ExeHost>
</EntryPoint>
</CodePackage>

Related

Add-SBHost : The system cannot find the file specified

I am attempting to add a Host to a newly created Windows Service Bus 1.1 farm but regardless of what I do I eternally get the following error:
VERBOSE: [11/16/2018 2:54:06 PM]: Validating input and configuration parameters.
VERBOSE: [11/16/2018 2:54:06 PM]: Installing auto-generated certificate.
VERBOSE: [11/16/2018 2:54:16 PM]: Granting 'Log on as Service' privilege to the run as account.
VERBOSE: [11/16/2018 2:54:16 PM]: Windows Fabric configuration started.
VERBOSE: [11/16/2018 2:54:28 PM]: Windows Fabric cluster manifest generated.
VERBOSE: [11/16/2018 2:54:28 PM]: Running Windows Fabric deployment.
Add-SBHost : The system cannot find the file specified
At line:1 char:1
+ Add-SBHost -SBFarmDBConnectionString "Data Source=MYHOST;Initial C ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Add-SBHost], Win32Exception
+ FullyQualifiedErrorId : System.ComponentModel.Win32Exception,Microsoft.ServiceBus.Commands.AddSBHost
I had been struggling with configuring the initial deployment of the farm because my organization uses Azure AD. I was following this very helpful Blog post to get through the installation and deployment but the issue I am seeing now isn't covered.
A Google of the issue leads me to this page where they talk about inspecting a DLL. I tried inspecting the Microsoft.ServiceBus.Commands.dll from within the Service Bus installation folder but, I'll be honest, I didn't understand enough to know what I was looking for.
Has anyone else run into this issue before? All suggestions of where I can look to find this are very much appreciated!
Based on my research of what is actually happening in Add-SBHost command, this error may occur when:
Code is trying create new temp file in %userprofile%\AppData\Local\Temp directory for something called "ClusterManifest".
Code is trying to execute FabricDeployer.exe (with created "ClusterManifest" file path as parameter) in directory which is defined in registry path: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Service Bus\1.1 for variable WinFabric in folder bin\Fabric\Fabric.Code.1.0. In my case, executable was placed in C:\Program Files\Windows Fabric\bin\Fabric\Fabric.Code.1.0\FabricDeployer.exe
Code is trying to remove temp file (created in 1 point) from %userprofile%\AppData\Local\Temp
After that steps and getting message VERBOSE: [09.08.2019 13:32:26]: Windows Fabric starting. no more file operations should be performed.
What to do?
First of all check if temp file is created in %userprofile%\AppData\Local\Temp directory (sort files by modification date in explorer, run script and wait) - probably file cannot be created because of lack of permissions.
If file is creating properly and has XML inside, then check if Service Fabric is installed and FabricDeployer.exe is present in directory. In my case it wasn't there so i had to remove Windows Fabric and Service Bus. After next installation i made sure that all files were in place.
After these steps script run was successful.
I hope it will help you :)

Appxmanifest definition for sideloading app

I have a active app on the Windows Store.
I want to distribute this app via a MDM system (MobileIron).
My store appxmanifest looks like this:
<Identity Name="MyApp" Publisher="CN=<Publisher-GUID>" Version="1000.2000.300.4001"/>
<mp:PhoneIdentity PhoneProductId="<PhoneProductId>" PhonePublisherId="<Publisher-GUID>"/>
My sideloading appxmanifest looks like this:
<Identity Name="MyApp" Publisher="OID.0.9.1234.21301800.500.5.3=2272904, CN=My Company, OU=My Company" Version="1000.2000.300.4001"/>
<mp:PhoneIdentity PhoneProductId="<PhoneProductId>" PhonePublisherId="<Publisher-GUID>"/>
If I now use the Microsoft Powershell script BuildMDILAPPX.ps1 i get a unknown error:
Powershell.exe -ExecutionPolicy Bypass -File "C:\Program Files (x86)\Microsoft SDKs\WindowsPhoneApp\v8.1\Tools\MDILXAPCompile\BuildMDILAPPX.ps1" -appxfilename ./MyApp.WP81_1000.2000.300.4001_arm.appxbundle -pfxfilename C:\SigningCert\symantec.pfx -password pw
UnPack the Appx
MakeAppx successfully extracted ./MyApp.WP81_1000.2000.300.4001_arm.appxbundle to C:\temp\APPXInput\MyApp.WP81_1606.3100.711.1567_arm.
Extract MyApp.WP81_1000.2000.300.4001_ARM.appx to temprorary folder ...
MakeAppx successfully extracted ./MyApp.WP81_1000.2000.300.4001_arm.appxbundle to C:\temp\APPXInput\MyApp.WP81_1606.3100.711.1567_arm.
Optimize Main Appx (MyApp.WP81_1000.2000.300.4001_ARM.appx) ...
EXITING SCRIPT
If I change the productid on my sideloading appxmanifest to a pseudo value:
<Identity Name="MyApp" Publisher="OID.0.9.1234.21301800.500.5.3=2272904, CN=My Company, OU=My Company" Version="1000.2000.300.4001"/>
<mp:PhoneIdentity PhoneProductId="<Publisher-GUID>" PhonePublisherId="<Publisher-GUID>"/>
The PS script successfully finishs. Deploying to MobileIron also works out, but if installing on a device I get a error
Installation failed. This app might already be installed
So my question is what value is expected on PhoneProductId on a sideloading manifest. How can I debug which error occurs on the BuildMDILAPPX.ps1? How can I see further log details if installation fails on a WP8.1 device?
Thanks in advance. Any help is appreciated!

RegAsm error RA0000 Could not load file or assembly on Network Drive

I experience a problem using a batch file to call Regasm on framework 4 on a network drive.
It works correctly when the dll is on a local drive.
The message is Could not load file or assembly filename.dll or one of its dependencies. Operation is not supported.
The problem is discussed
here ad "Darrens Developer Diary"
however editing the config as described does not help
I also tried the advice
here
which differs in the line
<loadFromRemoteSources="true"/>
with this I received a different error
"The system cannot execute the specified program"
The DLL used to use Framework 2, but I unregistered it using Framework 2 Regasm.
Here is the regasm.exe.config
<?xml version ="1.0"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<requiredRuntime safemode="true" imageVersion="v4.0.30319" version="v4.0.30319"/>
<supportedRuntime version="v4.0" sku="client" />
</startup>
<runtime>
<loadfromremotesources enabled="true"> </loadfromremotesources>
</runtime>
</configuration>
Here is the command in my batch file
Z:
cd foldername
c:\WINDOWS\Microsoft.Net\Framework\v4.0.30319/regasm /verbose /codebase /tlb: .\SBD.CommBridge.tlb .\SBD.ComBridge.dll
The correct line in regasm.exe.config is
<loadFromRemoteSources enabled="true"/>
the case matters

setting ACLs for subfolders using Web Deploy package

I’m trying to build a Deployment Package in Visual Web Developer Express 2010 which sets the ACL for a subfolder of the deployed website. I used the following information http://leethams.wordpress.com/2010/06/12/modifying-directory-permissions-with-web-deployment/
This is my test:
Create a new blank ASP.NET Application (WebApplication2 in this example)
In advanced compilation options, change .NET Framework target version to 3.5
Create a new folder (Config in this example) and add any file inside the folder
Create a new file called WebApplication2.wpp.targets, with this content
<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Extends the AfterAddIisSettingAndFileContentsToSourceManifest action do also set ACLs -->
<IncludeCustomACLs>TRUE</IncludeCustomACLs>
<AfterAddIisSettingAndFileContentsToSourceManifest Condition="'$(AfterAddIisSettingAndFileContentsToSourceManifest)'==''">
$(AfterAddIisSettingAndFileContentsToSourceManifest);
SetCustomACLs;
</AfterAddIisSettingAndFileContentsToSourceManifest>
</PropertyGroup>
<Target Name="SetCustomACLs" Condition="'$(IncludeCustomACLs)'=='TRUE'">
<Message Text="Adding Custom ACls" />
<ItemGroup>
<MsDeploySourceManifest Include="setAcl" Condition="$(IncludeSetAclProviderOnDestination)">
<setAclUser>anonymousAuthenticationUser</setAclUser>
<path>$(_MSDeployDirPath_FullPath)</path>
<setAclAccess>Read,Write</setAclAccess>
<setAclResourceType>Directory</setAclResourceType>
<AdditionalProviderSettings>setAclResourceType;setAclAccess</AdditionalProviderSettings>
</MsDeploySourceManifest>
</ItemGroup>
</Target>
</Project>
I execute from the command line and everything works fine:
-------------------------------------------------------
Start executing msdeploy.exe
-------------------------------------------------------
"C:\Program Files\IIS\Microsoft Web Deploy\\msdeploy.exe" -source:package='C:\T
emp\WebApplication2\WebApplication2\obj\Debug\Package\WebApplication2.zip' -dest
:auto,includeAcls='False' -verb:sync -disableLink:AppPoolExtension -disableLink:
ContentExtension -disableLink:CertificateExtension -setParamFile:"C:\Temp\WebApp
lication2\WebApplication2\obj\Debug\Package\WebApplication2.SetParameters.xml"
Info: Actualizando setAcl (Default Web Site/WebApplication2_deploy).
Info: Actualizando setAcl (Default Web Site/WebApplication2_deploy).
Info: Actualizando setAcl (Default Web Site/WebApplication2_deploy).
Número total de cambios: 3 (0 agregados, 0 eliminados, 3 actualizados, 0 parámet
ros cambiados, 0 bytes copiados)
Now, to set the permissions for the Config folder, I change the following line and rebuild the deployment package.
<path>$(_MSDeployDirPath_FullPath)/Config</path>
I get the following error:
-------------------------------------------------------
Start executing msdeploy.exe
-------------------------------------------------------
"C:\Program Files\IIS\Microsoft Web Deploy\\msdeploy.exe" -source:package='C:\T
emp\WebApplication2\WebApplication2\obj\Debug\Package\WebApplication2.zip' -dest
:auto,includeAcls='False' -verb:sync -disableLink:AppPoolExtension -disableLink:
ContentExtension -disableLink:CertificateExtension -setParamFile:"C:\Temp\WebApp
lication2\WebApplication2\obj\Debug\Package\WebApplication2.SetParameters.xml"
Info: Actualizando setAcl (Default Web Site/WebApplication2_deploy).
Info: Actualizando setAcl (Default Web Site/WebApplication2_deploy).
Info: Actualizando setAcl (C:\Temp\WebApplication2\WebApplication2\obj\Debug\Pac
kage\PackageTmp/Config).
Error: Se debe especificar un valor para 'setAclUser' cuando se usa el proveedor
'setAcl' con una ruta de acceso física.
Recuento de errores: 1.
In English it says: “Error: a value for ‘setAclUser’ must be specified when using the ‘setAcl’ provider with a physical path". Notice the third setAcl was changed to the physical path where the deployment package is located.
I then tried to modify it this way:
<AdditionalProviderSettings>setAclUser;setAclResourceType;setAclAccess</AdditionalProviderSettings>
But the error remains.
If I execute the deployment package with the “/t” switch, it does not throw the error, although it still shows the physical path.
I can hardcode the IIS path and change the line like this:
<path>Default Web Site/WebApplication2_deploy/Config</path>
It works fine. However, I wouldn’t like to do that, since the installation path need to be parameterized.
Changing the path to a backslassh makes no difference:
<path>Default Web Site/WebApplication2_deploy\Config</path>
Any help would be appreciated.
Thanks

Deploy to remote server using scp in NANT script

I am trying to copy a file to a remote server using scp task in Nant.Contrib .
I have used the following code to do that:
<target name= "QADeploy"description="gthtyb" >
<loadtasks assembly="C:\nantcontrib-0.85\bin\NAnt.Contrib.Tasks.dll" />
<echo message="htyh"/>
<scp file="D:\SourceTest\redist.txt" server="\\10.4.30.19" user="xxx:uuuu">
</scp>
</target>
But I am getting an error: scp failed to start. The system cannot find the file specified.
The code is as follows:
Then I have downloaded pscp.exe and modified the code as below:
<target name= "QADeploy"
description="gthtyb" >
<loadtasks assembly="C:\nantcontrib-0.85\bin\NAnt.Contrib.Tasks.dll" />
<echo message="htyh"/>
<scp file="D:\SourceTest\redist.txt" server="\\10.4.30.19" user="xxx:uuuu" program="C:\pscp\pscp.exe">
</scp>
Now I am getting the following error:
[scp] ssh_init:host does not exist
External Program Failed:C:\pscp\pscp.exe
can u please help whats the best way to copy a file to a remote server using Nant. I am using this code to deploy files to a remote server.
Thanks
You don't have to put two backslashes behind the IP of your server.
<scp file="D:\SourceTest\redist.txt" server="10.4.30.19" user="xxx:uuuu" program="C:\pscp\pscp.exe">
Also note that without the "path" parameter, the default destination folder is "~".
Update: it is the username that is crashing the pscp.exe program. Remove the ":" from your username or try with a different one.
it seems like there is some weirdness on how pscp parses paths in windows. The following should fix ssh_init:host does not exist problem:
-upload
pscp some.file user#[remote-host-or-ip]:/some/path/
-download
pscp user#[remote-host-or-ip]:/some/path/some.file some.file