I have a solution containing multiple .Net Core projects, some of which are dependent on other projects in the same solution. The whole solution is hosted in a Git repository of an on-premises TFS server.
I want to set up an automated build process on the TFS server. For lack of better knowledge, I use the Visual Studio build template and leave all the settings on their defaults. When I run the build process, it fails on the "Build solution" step with the error message
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Common.Targets(262,5): error : Project MyProject does not have a lock file.
Please run "dotnet restore" to generate a new lock file. [C:\TFSBuildAgent_work\6\s\MyProject\MyProject.xproj]
So I go ahead and create a PowerShell script with the content dotnet restore that I run before "Build solution" but after "Nuget restore". This also fails, this time on step "Dotnet restore" with the error message
Errors in C:\TFSBuildAgent_work\6\s\MyProject\project.json
Unable to resolve 'ProjectDependency (>= 1.0.0)' for '.NETFramework,Version=v4.6.1'.
When I run dotnet restore on my local machine, it completes without any issues.
Any help or hints are greatly appreciated!
dotnet restorefor each of them. Also, try deleting project.json.lock file on your local machine and re-rundotnet restorejust for testing. Do you have the same .NET and .NET Core framework versions installed on both machines? - Ignas1.0.0-preview2-003131for the CLI tools on both machines, the .Net framework versions are the same too.dotnet restoresteps into all subfolders. I deleted the.lock.jsonfile,dotnet restorestill works on my local machine. - Thaodendotnet --verbose restore... to get more detailed output - DaveShawdotnet restorewill then pull it from the server and build the whole project. Not the nicest way, but at least it's working. - Thaoden