0

My infrastructure now has TFS 2015, but we started a new project in .NET Standard. Our build server now has VS2017, and the project builds when loaded within VS2017 in that server.

When we set a new build definition to run the build through the build agent, then it fails. Seems even that System is not found:

Error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)

Is there any simple thing to do to make it work, ir we will have to migrate to the new build steps to make it work? Some workaround?

Fabito
  • 1,165
  • 2
  • 13
  • 30
  • Does the `System` package being present in your nuget file? – VMAtm Apr 26 '17 at 22:13
  • .NET Core or .NET Standard don't have that included in the project, they have the references and it is restored during the build process. – Fabito Apr 27 '17 at 06:49

2 Answers2

0

I find a workaround for that. Simply I gave up of using the TFS 2015 build steps MSBUILD and Visual Studio Build, and now I am using the Command Line step. Calling the commands from there:

dotnet restore dotnet build

That does the trick.

Fabito
  • 1,165
  • 2
  • 13
  • 30
0

enter image description here

This is because we need to do our restore a different way using the .net core restore. You could fix this by adding the .NET Core (PREVIEW) task to the build definition or just use command line task. With command line task could running dotnet restore, dotnet build, dotnet publish, and dotnet test.

More details please take a look at this blog: Setting up .net core continuous integration build with VSTS/TFS

For command line solution please refer vsts-agent Build Definition for .NET Core (with Test Results) Also take a look at this similar question: Visual studio team services build .net core 1.1

Community
  • 1
  • 1
PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62