File in use Error service Fabric


I have a really annoying issue with service fabric where I am now getting a file in use error

This makes no sense because I have reset the cluster, rebooted, etc and nothing works

The problem is that the message is useless

    12>powershell -NonInteractive -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -Command ". 'PATH\Scripts\Deploy-FabricApplication.ps1' -ApplicationPackagePath 'PATH\pkg\Debug' -PublishProfileFile 'PATH\PublishProfiles\Local.5Node.xml' -DeployOnly:$true -ApplicationParameter:@{} -UnregisterUnusedApplicationVersionsAfterUpgrade $false -OverrideUpgradeBehavior 'None' -OverwriteBehavior 'Always' -SkipPackageValidation:$true -ErrorAction Stop"
12>Copying application to image store...
12>Upload to Image Store succeeded
12>Registering application type...
12>Register-ServiceFabricApplicationType : One or more errors occurred. --> AggregateException: One or more errors 
12>occurred. --> FileLoadException: The process cannot access the file because it is being used by another process. 
12>(Exception from HRESULT: 0x80070020)
12>At C:\Program Files\Microsoft SDKs\Service 
12>Fabric\Tools\PSModule\ServiceFabricSDK\Publish-NewServiceFabricApplication.ps1:251 char:9
12>+         Register-ServiceFabricApplicationType -ApplicationPathInImage ...
12>+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12>    + CategoryInfo          : InvalidOperation: (Microsoft.Servi...usterConnection:ClusterConnection) [Register-Servic 
12>   eFabricApplicationType], FabricException
12>    + FullyQualifiedErrorId : RegisterApplicationTypeErrorId,Microsoft.ServiceFabric.Powershell.RegisterApplicationTyp 
12>   e
12>Finished executing script 'Deploy-FabricApplication.ps1'.
12>Time elapsed: 00:00:45.6667428
12>The PowerShell script failed to execute.

How can I get more information about the exact file that is in use?

I am trying to deploy into a dev cluster



asked on Stack Overflow Mar 21, 2018 by Paul

1 Answer


This appears to have been caused by Trend real time scanner!

answered on Stack Overflow Mar 22, 2018 by Paul

User contributions licensed under CC BY-SA 3.0