Hammad
Hammad

Reputation: 171

Use VSTS to build a solution with VSTS Packages and old style csproj

I've a solution that has the following:

  1. multiple libraries net461 with old style csproj
  2. multiple projects net461 with new csproj (Net core libraries and we applications but tatgets net461) and references the old style csproj projects.
  3. I use VSTS Packages to manage some private nuget packages

I've VS 15.3 installed in my laptop and the build is working great but, on VSTS the build is failing. I tried the following scenarios

  1. When I use dotnet restore (the new tooling), the build fail on restore on the old style csproj and mentioned it's failed to build (I made sure to use the tool to restore only no build involved)
  2. When I use nuget restore, I got the below failure message Error : Assets file '[path_to_project_on_agent]\obj\project.assets.json' not found. Run a NuGet package restore to generate this file. which is mentioned here in this github issue https://github.com/Microsoft/vsts-tasks/issues/3762

I need to know what is the correct tasks to get this project building. Thanks,

Upvotes: 3

Views: 3377

Answers (1)

Hammad
Hammad

Reputation: 171

Finally I resolved the issue by

  1. Use NuGet Tool Installer to install Nuget Version 4.3.0
  2. Run Nuget Restore on the Solution file
  3. Use Visual Studio 2015 Build Task without clean and without restore on the Solution File

I hope it helps someone.

Upvotes: 4

Related Questions