0
votes

Hi I am trying to configure a continuous deployment build on VSTS but I can not seem to make the build work. I should also mention that I just started learning VSTS a week ago so I might miss something pretty obvious. Here is what I have done so far:

I have created a Visual Studio Build step with the following configuration:

  1. Solution: $/Commercify/Dev/Commercify.sln
  2. MSBuild Arguments :

/p:DeployOnBuild=true

/p:WebPublishMethod=Package

/p:PackageAsSingleFile=true

/p:SkipInvalidConfigurations=true

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

  1. Platform : $(BuildPlatform)

  2. Configuration: $(BuildConfiguration)

  3. Clean: True

7: Visual Studio Version:Visual Stiudio 2015

8: I have enabled nugget restore packages in advanced

When this build step gets run I get the following errors:

enter image description here

My application is build with asp.net core and I have multiple .net core class libraries. The class libraries have just been created and have the default project.json that is generated by visual studio:

    {
  "version": "1.0.0-*",

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

And this is my asp.net core project.json file:

    {
  "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%" ]
  }
}

I first tried running a build step that runs dotnet restore, but nothing seems to change.

Anyone know what is wrong?

1

1 Answers

0
votes

Please follow the instructions here to build a Asp.Net Core project for deployment: Define a deployment build.