Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build of project fails on Visual Studio Team Services - missing lock file

I am trying to configure CI for my team project, however, my build doesn't get past the first library project. It is complaining about missing the lock file. I have configured nugget to restore but that doesn't seem to create the lock file. Git ignores the lock file so it is not put in repository.

   Summary
| Build
3 error(s), 0 warning(s) 
Build - 3 error(s), 0 warning(s) 
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets(241):Project Core does not have a lock file.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets(241):Project Core does not have a lock file.
Process 'msbuild.exe' exited with code '1'.
| Finalize build
0 error(s), 0 warning(s) 

Does anyone know how to force build to create the lock file?

My solution is an ASP.NET Core RC2 website. It builds fine on VS 2015. Microsoft announce ASP.NET Core last week so it should be on the build servers, or do I have to create my own build server?

Here is the contents of my project.json file for the Core Library:

{
  "version": "1.0.0-*",

  "dependencies": {
    "Microsoft.AspNetCore.Identity": "1.0.0-rc2-final",
    "Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final",
    "Microsoft.EntityFrameworkCore": "1.0.0-rc2-final",
    "Microsoft.Extensions.Caching.Abstractions": "1.0.0-rc2-final",
    "Microsoft.Extensions.Logging": "1.0.0-rc2-final",
    "NETStandard.Library": "1.5.0-rc2-24027",
    "NodaTime": "2.0.0-alpha20160523"
  },

  "frameworks": {
    "netstandard1.5": {
      "dependencies": {
        "System.ComponentModel.Annotations": "4.1.0-rc2-24027"
      },
      "imports": [ "dnxcore50", "portable-net45+win8" ]
    }
  }
}
like image 969
phitch Avatar asked Jul 02 '16 20:07

phitch


1 Answers

You can solve this by adding a new build step to your build definition.

Add a 'Command Line' task as step 1 of your build definition.

The settings for this task are:

Tool: dotnet

Arguments: restore

You can also speed this up a little by adding the following variable to your build definition: DOTNET_SKIP_FIRST_TIME_EXPERIENCE = true

like image 126
Gordon Rudman Avatar answered Nov 15 '22 08:11

Gordon Rudman