より良いエンジニアを目指して

1日1つ。良くなる!上手くなる!

AzureDevOpsで「The system cannot find the file specified. 」

Azure DevOpsのPipelineでNuGet Commandにて以下のようなエラー。

2020-04-07T13:41:49.9584598Z MSBuild auto-detection: using msbuild version '16.5.0.12403' from 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\bin'. Use option -MSBuildVersion to force nuget to use a specific version of MSBuild.
2020-04-07T13:41:49.9586216Z NuGet.CommandLine.CommandLineException: Error parsing solution file at d:\a\1\s\{SolutionName}.sln: Exception has been thrown by the target of an invocation.  The project file could not be loaded. Could not load file or assembly 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.  d:\a\1\s\{SolutionName}.sln

特にプロジェクト系の設定変えた覚えないんだけど。

AzureDevOpsの環境が何か変わったのでしょうか。

私の場合、.nuGetフォルダを削除しました。

というのも、.NETFrameworkで開発していたプロジェクトを.NETCoreに移行したため、ソリューションに.nuGetフォルダが残っていました。

Visual Studioから.nuGetフォルダを削除を実施しました。

すると、NuGetCommandは成功しました。