locked
I am getting a error uploding to ftp server RRS feed

  • Question

  • User-1674296013 posted

    hi;

    I am working on .Net Core 3.1 ,I published the api to host and when I tested everything looks good 

    I added the some features and try to upload by ftp ,it was return a error like below

    550 The process cannot access the file because it is being used by another process.Maybe it will fix by restarting to iis But problem will continue

    I think I missed the some features ,maybe its dispos or else .

    Saturday, December 26, 2020 12:05 PM

All replies

  • User1686398519 posted

    Hi alya14, 

    550 The process cannot access the file because it is being used by another process

    As the error message prompts, you can close WebAPI first, and then republish.

    Best Regards,

    YihuiSun

    Monday, December 28, 2020 9:50 AM
  • User-1674296013 posted

    YihuiSun

    Hi alya14, 

    alya14

    550 The process cannot access the file because it is being used by another process

    As the error message prompts, you can close WebAPI first, and then republish.

    Best Regards,

    YihuiSun

    its easy to in local iis,it was harder to do on hosting,I shouldn't always ask the support team for help,please restart the pool or iis,its comic 

    Monday, December 28, 2020 10:26 AM
  • User753101303 posted

    Hi,

    Using App Offline file (app_offline.htm) | Microsoft Docs could be another option to gracefully shutdown the site. Some hosting services have also support for Web Deploy and more to have this done for you.

    Monday, December 28, 2020 10:34 AM
  • User-1674296013 posted

    Hi,

    Using App Offline file (app_offline.htm) | Microsoft Docs could be another option to gracefully shutdown the site. Some hosting services have also support for Web Deploy and more to have this done for you.

    hi , I can't apply to that artice due to I am away from hosting server

    also I added the below code but nothing change.

    <Target Name="PreBuild" BeforeTargets="PreBuildEvent">
        <Touch Files="app_offline.htm" AlwaysCreate="true" />
      </Target>
    
    
      <Target Name="PostBuild" AfterTargets="PostBuildEvent">
        <Delete Files="app_offline.htm" />
      </Target>
    Monday, December 28, 2020 12:17 PM
  • User753101303 posted

    More likely the file is deleted right after the build but before it is published. I would try "by hand" first and automate later but more likely:
    - make sure app_offline.htm is published first
    - then publish all other files
    - and then remove app_offline.htm

    If you have a "Web Deploy" option available it should do that for you. On my side I'm using azure-pipelines-tasks/Tasks/IISWebAppDeploymentOnMachineGroupV0 at master · microsoft/azure-pipelines-tasks · GitHub which uses Web Deploy behind the scene:

    "Take Application Offline: Select the option to take the Web App offline by placing an app_offline.htm file in the root directory of the Web App before the sync operation begins. The file will be removed after the sync operation completes successfully."

    Monday, December 28, 2020 1:10 PM