3

I've set up a build step using msbuild (Microsoft BuildTools 2019, ToolsVersion 16.0)

If I set build target to Release, I get the error in the title. If I set build target to Debug, I get the equivalent error.

If I don't set a build target at all, I get: NETSDK1004: Assets file 'C:\TeamCity\buildAgent\work\b8126aa0ba178445\Test\Application\Matisa.Test.ApplicationEnums\obj\project.assets.json' not found

I've tried switching to .NET CLI builder, but it gives the same error.

Benjol
  • 63,995
  • 54
  • 186
  • 268

2 Answers2

4

It seems that you need to run dotnet restore in your pipeline somehow. You can try to add .NET CLI step with restore command to your build definition and place it before your msbuild step.

scor4er
  • 1,580
  • 12
  • 23
  • Thanks, I added Restore as a target and that (combined with correcting the silly bug in my answer) seems to have fixed the problem. – Benjol Apr 07 '20 at 05:44
2

Sorry, silly me...

The target isn't Debug or Release, it's Build/Restore etc... Got mixed up.

Debug or Release goes in Parameters.

Benjol
  • 63,995
  • 54
  • 186
  • 268