My site has two website projects. One of them references Microsoft.CodeDom.Providers.DotNetCompilerPlatform. We have recently upgraded this from 3.6.0 to 4.1.0 as part of a wider upgrade project.
The two projects both build, publish and run on my local machine as expected. I've also been able to use WebDeploy to publish both to a UAT environment with no issues there either. The problem is that it errors in Devops (unchanged by the upgrade project), see below.
Error:
Admin\CMS\CMSApp.csproj(14677,5): Error : This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.3.6.0\build\net472\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.targets.
Project "D:\a\1\s\Admin\CMS\CMSApp.csproj" on node 1 (default targets).
The pipeline first runs nuget restore, which correctly restores v4.1.0 of the package as expected. The next step is to build the project, which uses a Visual Studio Build task (details below):
