使用部署包配置在VSTS中运行Visual Studio Build会导致多个错误

时间:2016-07-28 11:22:00

标签: asp.net-core azure-devops

您好我正在尝试在VSTS上配置持续部署构建,但我似乎无法使构建工作。我还要提一下,我刚刚开始学习一周前的VSTS,所以我可能会错过很明显的东西。以下是我到目前为止所做的事情:

我已使用以下配置创建了Visual Studio Build步骤:

  1. 解决方案:$ / Commercify / Dev / Commercify.sln
  2. MSBuild参数:
  3.   

    / p:DeployOnBuild = true

         

    / p:WebPublishMethod = Package

         

    / p:PackageAsSingleFile = true

         

    / p:SkipInvalidConfigurations = true

         

    / P:PackageLocation =" $(build.artifactstagingdirectory)\"

    1. 平台:$(BuildPlatform)

    2. 配置:$(BuildConfiguration)

    3. 清洁:真实

    4. 7:Visual Studio版本:Visual Stiudio 2015

      8:我已在高级

      中启用了块恢复包

      当此构建步骤运行时,我收到以下错误:

      enter image description here

      我的应用程序是使用asp.net核心构建的,我有多个.net核心类库。刚刚创建了类库,并且具有由visual studio生成的默认project.json:

          {
        "version": "1.0.0-*",
      
        "dependencies": {
          "NETStandard.Library": "1.6.0",
          "Microsoft.EntityFrameworkCore.SqlServer": "1.0.0"
        },
        "frameworks": {
          "netstandard1.6": {
            "imports": "dnxcore50"
          }
        }
      }
      

      这是我的asp.net核心project.json文件:

          {
        "dependencies": {
          "Microsoft.NETCore.App": {
            "version": "1.0.0",
            "type": "platform"
          },
          "Microsoft.AspNetCore.Diagnostics": "1.0.0",
          "Microsoft.AspNetCore.Mvc": "1.0.0",
          "Microsoft.AspNetCore.Razor.Tools": {
            "version": "1.0.0-preview2-final",
            "type": "build"
          },
          "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
          "Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
          "Microsoft.AspNetCore.StaticFiles": "1.0.0",
          "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
          "Microsoft.Extensions.Configuration.Json": "1.0.0",
          "Microsoft.Extensions.Logging": "1.0.0",
          "Microsoft.Extensions.Logging.Console": "1.0.0",
          "Microsoft.Extensions.Logging.Debug": "1.0.0",
          "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
          "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0"
        },
      
        "tools": {
          "BundlerMinifier.Core": "2.0.238",
          "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
          "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
        },
      
        "frameworks": {
          "netcoreapp1.0": {
            "imports": [
              "dotnet5.6",
              "portable-net45+win8"
            ]
          }
        },
      
        "buildOptions": {
          "emitEntryPoint": true,
          "preserveCompilationContext": true
        },
      
        "runtimeOptions": {
          "configProperties": {
            "System.GC.Server": true
          }
        },
      
        "publishOptions": {
          "include": [
            "wwwroot",
            "Views",
            "Areas/**/Views",
            "appsettings.json",
            "web.config"
          ]
        },
      
        "scripts": {
          "prepublish": [ "dotnet bundle" ],
          "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
        }
      }
      

      我首先尝试运行运行dotnet还原的构建步骤,但似乎没有任何改变。

      任何人都知道出了什么问题?

1 个答案:

答案 0 :(得分:0)

请按照此处的说明构建用于部署的Asp.Net Core项目:Define a deployment build