【问题标题】:Web Deploy cannot modify the file 'xxx.exe' on the destination because it is locked by an external processWeb 部署无法修改目标上的文件“xxx.exe”,因为它被外部进程锁定
【发布时间】:2016-12-22 09:44:26
【问题描述】:

我在 Visual Studio 中创建了一个新的 ASP.NET Core Web 应用程序 (.Net Framework)。我正在使用 .NET Framework 4.5.2。我右键单击项目并选择发布,以使用 Web 部署将项目发布到 Azure。第一次尝试失败“缺少根元素”或类似的东西。第二次尝试成功。但是每次我尝试将项目发布到 Azure 中的应用程序站点之后,我都会收到错误消息:

Web Deploy 无法修改目标上的文件“xxx.exe”,因为它已被外部进程锁定。

这是为什么?

我找不到解决方案...是否无法以最简单/正常的发布方式将 ASP.NET Core Web 应用程序 (.Net Framework) 发布到 Azure?

我的 project.json 看起来像这样:

    {
  "dependencies": {
    "AutoMapper": "3.2.1",
    "Dropbox.Api": "3.4.0",
    "EnterpriseLibrary.TransientFaultHandling": "6.0.1304",
    "EntityFramework": "6.1.3",
    "Klarna.Net.Api": "4.0.0",
    "Microsoft.AspNetCore.Mvc": "1.1.0",
    "Microsoft.AspNetCore.Routing": "1.1.0",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
    "Microsoft.Azure.DocumentDB": "1.10.0",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
    "Microsoft.Extensions.Configuration.FileExtensions": "1.1.0",
    "Microsoft.Extensions.Configuration.Json": "1.1.0",
    "Microsoft.Extensions.Logging": "1.1.0",
    "Microsoft.Extensions.Logging.Console": "1.1.0",
    "Microsoft.Extensions.Logging.Debug": "1.1.0",
    "Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0",
    "PDFsharp": "1.32.3057",
    "RavenDB.Client": "2.5.2910",
    "SaasKit.Multitenancy": "1.1.4",
    "Stripe.net": "6.0.1",
    "IdentityServer4.AccessTokenValidation": "1.0.1-rc5",
    "Newtonsoft.Json": "9.0.1",
    "Microsoft.AspNetCore.Cors": "1.1.0",
    "Microsoft.AspNetCore.Diagnostics": "1.1.0",
    "Microsoft.AspNetCore.StaticFiles": "1.1.0",
    "Swashbuckle": "6.0.0-beta902"
  },

  "tools": {
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": {
      "version": "1.1.0-preview4-final",
      "imports": "portable-net45+wp80+win8+wpa81+dnxcore50"
    }
  },

  "frameworks": {
    "net452": {
      "dependencies": {
        "Adocka.Common": {
          "target": "project"
        },
        "Adocka.Core": {
          "target": "project"
        },
        "Adocka.Core.Dto": {
          "target": "project"
        },
        "Adocka.Dal": {
          "target": "project"
        }
      }
    }
  },

  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true,
    "xmlDoc": true
  },
  "publishOptions": {
    "include": [
      "wwwroot",
      "**/*.cshtml",
      "appsettings.json",
      "web.config"
    ]
  },
  "runtimeOptions": {
    "configProperties": {
      "System.GC.Server": true
    }
  },
  "scripts": {
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  }
}

【问题讨论】:

    标签: asp.net azure asp.net-core azure-web-app-service webdeploy


    【解决方案1】:

    如果您已经发布了应用并且它正在运行,通常会发生这种情况,因此您会收到错误消息。

    进行部署时,首先停止您的 Web 应用程序(从 Azure 门户中选择您的 Web 应用程序并按停止按钮),进行部署并重新启动它。您也可以使用 powershell 脚本自动执行该过程。

    【讨论】:

    • 真的需要这个吗??停止我的生产网络应用程序与许多并发用户/访问者并发布新版本......听起来是个非常糟糕的主意......微软已经解决了很多伟大的事情,开源一切,使其跨平台,使其自我托管etcetc...但是在最后一步失败,您无法将完成的应用程序发布到 azure....?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-11-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-28
    相关资源
    最近更新 更多