Zain Nabi
Zain Nabi

Reputation: 1

System.Text.Json - Team Foundation Server Cant Find Namspace

I am current having issues on the Continuous Integration process to Microsoft team foundation server. The namespace System.Text.Json cannot be found. As a result the build is failing on TFS

However it does work on my local visual studio:

Team foundation server Build:
Team foundation server Build

Visual Studio: Visual Studio

Build Definition: Build Definition

[4]: https://i.sstatic.net/jlTnU.png

Upvotes: 0

Views: 43

Answers (1)

tmaj
tmaj

Reputation: 35017

In summary, you will need to give your pipeline a bit of love and update to build a new .NET (e.g. .NET6) codebase.

The output from the build agent suggest the build process for .NET framework.

You may to update a YAML pipeline and build you sln with something like:

- task: DotNetCoreCLI@2
  displayName: 'Build abc and tests'
  inputs:
    command: 'build'
    projects: |
      .../.../abc.csproj
      .../.../abc.tests.csproj
    arguments: '--configuration Release'

You can stay with classic pipelines and use the .NET Core task:

enter image description here


Btw. your build agent uses an old version of Nuget (4.6). The current version is around 6.2.

Upvotes: -1

Related Questions