2

ISSUE

The Visual Studio Build task in a Visual Studio Team Services build for a solution that contains a default ASP.NET MVC website and a default Unit Test Project is failing to find references. This task runs after a NuGet Restore that should install these references, but even though the NuGet Restore task succeeds, the references are not installed on the server running this build.

Visual Studio Team Services Logs

The error logs have been uploaded to This Github Repository

Attempted Fixes

In an effort to ensure that the packages are properly referenced by the project, all of the NuGet packages were reinstalled from Package Manager using the following command:

PM> Update-Package --reinstall

This only caused MSBuild to not find Microsoft.Net.Compilers.props in both the projects. So in an attempt to correct this, the version of Microsoft.Net.Compilers.props in the project was dropped to version 2.3.2. However, this only brought back the original errors where the MSTest.TestAdapter.props and Microsoft.Net.Compilers.props references could not be found.

Kmaster
  • 21
  • 5
  • Can you post the contento of your SampleWebSiteForDemo.csproj file...or you can add it to the repo – Hackerman Nov 30 '17 at 16:36
  • @Hackerman sample website files have been added to the [repository](https://github.com/Fredison/MSBuildError/tree/master/SampleWebsite) – Kmaster Nov 30 '17 at 17:49
  • Delete this line `` then install the package again...and also delete the `` – Hackerman Nov 30 '17 at 18:14

1 Answers1

0

Try it with these tasks (works fine for me with the sample solution you shared):

  1. NuGet Tool Installer (Version of NuGet.exe to install: 4.3.0)
  2. NuGet restore (Choose 2.* version)
  3. Visual Studio Build (Visual Studio Version: Latest)
  4. Queue build with the agent that has VS2017 installed.
starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53
  • 1
    I am getting an `ERR:connect ETIMEDOUT 72.21.81.200:443` that is causing the NuGet Tool Installer task to fail, my theory is that this is due to the fact that I am operating behind a proxy. I have supplied proxy authentication to the agent, but does this task also require it's own credentials? If so, how do I provide them? – Kmaster Dec 01 '17 at 13:22
  • 1
    Try to specify proxy in config file: https://stackoverflow.com/questions/9232160/nuget-behind-proxy#answer-15463892 – starian chen-MSFT Dec 04 '17 at 01:20